<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>12.后台系统-上传医院信息 | Teng&#39;s blog</title>
    <meta name="generator" content="VuePress 1.9.7">
    <link rel="icon" href="/logo/favicon.ico">
    <meta name="description" content="">
    <meta name="keywords" content="大数据,java,h5,前端,人工智能,深度学习,go">
    <meta name="theme-color" content="#3eaf7c">
    
    <link rel="preload" href="/assets/css/0.styles.c17b3ac5.css" as="style"><link rel="preload" href="/assets/js/app.ab6a7ec7.js" as="script"><link rel="preload" href="/assets/js/2.bc9beebf.js" as="script"><link rel="preload" href="/assets/js/33.4f600444.js" as="script"><link rel="prefetch" href="/assets/js/10.829fbe09.js"><link rel="prefetch" href="/assets/js/100.21819a92.js"><link rel="prefetch" href="/assets/js/101.cba9a2fb.js"><link rel="prefetch" href="/assets/js/102.866a5b15.js"><link rel="prefetch" href="/assets/js/103.fdb7598a.js"><link rel="prefetch" href="/assets/js/104.75b80350.js"><link rel="prefetch" href="/assets/js/105.3030b5b8.js"><link rel="prefetch" href="/assets/js/106.11a5a8f2.js"><link rel="prefetch" href="/assets/js/107.232bdd92.js"><link rel="prefetch" href="/assets/js/108.a619d3d9.js"><link rel="prefetch" href="/assets/js/109.d31480d9.js"><link rel="prefetch" href="/assets/js/11.18a3d2d0.js"><link rel="prefetch" href="/assets/js/110.7b7051ad.js"><link rel="prefetch" href="/assets/js/111.6976153b.js"><link rel="prefetch" href="/assets/js/112.935a63bd.js"><link rel="prefetch" href="/assets/js/113.77296509.js"><link rel="prefetch" href="/assets/js/114.3ab3be4a.js"><link rel="prefetch" href="/assets/js/115.9b0dac10.js"><link rel="prefetch" href="/assets/js/116.55bc2cd6.js"><link rel="prefetch" href="/assets/js/117.75bd6d05.js"><link rel="prefetch" href="/assets/js/118.0dae142d.js"><link rel="prefetch" href="/assets/js/119.b1a2888c.js"><link rel="prefetch" href="/assets/js/12.81e292a4.js"><link rel="prefetch" href="/assets/js/120.6a3fd99f.js"><link rel="prefetch" href="/assets/js/121.ea1e1714.js"><link rel="prefetch" href="/assets/js/122.125ebe03.js"><link rel="prefetch" href="/assets/js/123.ec5bcef7.js"><link rel="prefetch" href="/assets/js/124.f346a2dc.js"><link rel="prefetch" href="/assets/js/125.11061d5a.js"><link rel="prefetch" href="/assets/js/126.7f8bc26b.js"><link rel="prefetch" href="/assets/js/127.26df99b6.js"><link rel="prefetch" href="/assets/js/128.0d4aae4f.js"><link rel="prefetch" href="/assets/js/129.ec01b50e.js"><link rel="prefetch" href="/assets/js/13.89c37359.js"><link rel="prefetch" href="/assets/js/130.9e570618.js"><link rel="prefetch" href="/assets/js/131.ffaed293.js"><link rel="prefetch" href="/assets/js/132.6ef77a2c.js"><link rel="prefetch" href="/assets/js/133.893078b6.js"><link rel="prefetch" href="/assets/js/134.a5229ebf.js"><link rel="prefetch" href="/assets/js/135.e1015261.js"><link rel="prefetch" href="/assets/js/136.655ac222.js"><link rel="prefetch" href="/assets/js/137.4c18a7dc.js"><link rel="prefetch" href="/assets/js/138.17cf92aa.js"><link rel="prefetch" href="/assets/js/139.7e23a82f.js"><link rel="prefetch" href="/assets/js/14.5a11397f.js"><link rel="prefetch" href="/assets/js/140.570f33f7.js"><link rel="prefetch" href="/assets/js/141.eb538cc8.js"><link rel="prefetch" href="/assets/js/142.2f38d42f.js"><link rel="prefetch" href="/assets/js/143.a32de735.js"><link rel="prefetch" href="/assets/js/144.76a63ee6.js"><link rel="prefetch" href="/assets/js/145.42483d13.js"><link rel="prefetch" href="/assets/js/146.068119e8.js"><link rel="prefetch" href="/assets/js/147.64de6f65.js"><link rel="prefetch" href="/assets/js/148.5709a561.js"><link rel="prefetch" href="/assets/js/149.9373f1d3.js"><link rel="prefetch" href="/assets/js/15.f98080cd.js"><link rel="prefetch" href="/assets/js/150.85328596.js"><link rel="prefetch" href="/assets/js/151.8179d926.js"><link rel="prefetch" href="/assets/js/152.357ef7ac.js"><link rel="prefetch" href="/assets/js/153.a7f37700.js"><link rel="prefetch" href="/assets/js/154.259e0731.js"><link rel="prefetch" href="/assets/js/155.609478f3.js"><link rel="prefetch" href="/assets/js/156.c02413b4.js"><link rel="prefetch" href="/assets/js/157.4225246d.js"><link rel="prefetch" href="/assets/js/158.90aa3193.js"><link rel="prefetch" href="/assets/js/159.48a36d7f.js"><link rel="prefetch" href="/assets/js/16.c2c39a12.js"><link rel="prefetch" href="/assets/js/160.1483c525.js"><link rel="prefetch" href="/assets/js/161.935da955.js"><link rel="prefetch" href="/assets/js/162.623fec51.js"><link rel="prefetch" href="/assets/js/163.9b588340.js"><link rel="prefetch" href="/assets/js/164.30ec5aba.js"><link rel="prefetch" href="/assets/js/165.189a8317.js"><link rel="prefetch" href="/assets/js/166.5af6c2ec.js"><link rel="prefetch" href="/assets/js/167.9dff1ac7.js"><link rel="prefetch" href="/assets/js/168.622f7001.js"><link rel="prefetch" href="/assets/js/169.2e7169b6.js"><link rel="prefetch" href="/assets/js/17.b69c805b.js"><link rel="prefetch" href="/assets/js/170.722cbe91.js"><link rel="prefetch" href="/assets/js/171.bc79c387.js"><link rel="prefetch" href="/assets/js/172.ee6817b8.js"><link rel="prefetch" href="/assets/js/173.b35d740e.js"><link rel="prefetch" href="/assets/js/174.5c6e7df5.js"><link rel="prefetch" href="/assets/js/175.d4a5903b.js"><link rel="prefetch" href="/assets/js/176.7be8b3ab.js"><link rel="prefetch" href="/assets/js/177.21a314f9.js"><link rel="prefetch" href="/assets/js/178.7c287ca3.js"><link rel="prefetch" href="/assets/js/179.b4682242.js"><link rel="prefetch" href="/assets/js/18.8b504010.js"><link rel="prefetch" href="/assets/js/180.0098b166.js"><link rel="prefetch" href="/assets/js/181.1ade00c6.js"><link rel="prefetch" href="/assets/js/182.2cdebd59.js"><link rel="prefetch" href="/assets/js/183.019718a7.js"><link rel="prefetch" href="/assets/js/184.d4ab9703.js"><link rel="prefetch" href="/assets/js/185.50d60e28.js"><link rel="prefetch" href="/assets/js/186.3a98e144.js"><link rel="prefetch" href="/assets/js/187.9ed4524b.js"><link rel="prefetch" href="/assets/js/188.c3a8a353.js"><link rel="prefetch" href="/assets/js/189.b949cdaa.js"><link rel="prefetch" href="/assets/js/19.6860ea74.js"><link rel="prefetch" href="/assets/js/190.7a54fb5e.js"><link rel="prefetch" href="/assets/js/191.804d06a5.js"><link rel="prefetch" href="/assets/js/192.c729ba9b.js"><link rel="prefetch" href="/assets/js/193.e8d492ad.js"><link rel="prefetch" href="/assets/js/194.49b4668e.js"><link rel="prefetch" href="/assets/js/195.e4508c24.js"><link rel="prefetch" href="/assets/js/196.538420c6.js"><link rel="prefetch" href="/assets/js/197.56fda656.js"><link rel="prefetch" href="/assets/js/198.75e420ad.js"><link rel="prefetch" href="/assets/js/199.67784aef.js"><link rel="prefetch" href="/assets/js/20.82f2e898.js"><link rel="prefetch" href="/assets/js/200.b32cd750.js"><link rel="prefetch" href="/assets/js/201.594db75b.js"><link rel="prefetch" href="/assets/js/202.70b380ec.js"><link rel="prefetch" href="/assets/js/203.0de30338.js"><link rel="prefetch" href="/assets/js/204.360c28c7.js"><link rel="prefetch" href="/assets/js/205.5b4b553b.js"><link rel="prefetch" href="/assets/js/206.6bd13fc8.js"><link rel="prefetch" href="/assets/js/207.875be01b.js"><link rel="prefetch" href="/assets/js/208.00694e2b.js"><link rel="prefetch" href="/assets/js/209.1fa15603.js"><link rel="prefetch" href="/assets/js/21.3f050c1d.js"><link rel="prefetch" href="/assets/js/210.f11e4fe3.js"><link rel="prefetch" href="/assets/js/211.a9beca8a.js"><link rel="prefetch" href="/assets/js/212.2fb3a3b1.js"><link rel="prefetch" href="/assets/js/213.c2fb7dcf.js"><link rel="prefetch" href="/assets/js/214.7613f2f7.js"><link rel="prefetch" href="/assets/js/215.ac00cd4b.js"><link rel="prefetch" href="/assets/js/216.926eb535.js"><link rel="prefetch" href="/assets/js/217.e03af99a.js"><link rel="prefetch" href="/assets/js/218.0212a1a9.js"><link rel="prefetch" href="/assets/js/219.318a1817.js"><link rel="prefetch" href="/assets/js/22.f2a18e55.js"><link rel="prefetch" href="/assets/js/220.34f368ec.js"><link rel="prefetch" href="/assets/js/221.1d325330.js"><link rel="prefetch" href="/assets/js/222.f8ac9e1e.js"><link rel="prefetch" href="/assets/js/223.1d081b10.js"><link rel="prefetch" href="/assets/js/224.d4a3c833.js"><link rel="prefetch" href="/assets/js/225.86046773.js"><link rel="prefetch" href="/assets/js/226.ee01e5ed.js"><link rel="prefetch" href="/assets/js/227.cc700349.js"><link rel="prefetch" href="/assets/js/228.121d2708.js"><link rel="prefetch" href="/assets/js/229.411a1a59.js"><link rel="prefetch" href="/assets/js/23.8416a606.js"><link rel="prefetch" href="/assets/js/230.ce1cd57d.js"><link rel="prefetch" href="/assets/js/231.9e415c00.js"><link rel="prefetch" href="/assets/js/232.af1434b0.js"><link rel="prefetch" href="/assets/js/233.aedf0a69.js"><link rel="prefetch" href="/assets/js/234.7343179f.js"><link rel="prefetch" href="/assets/js/235.3ea94188.js"><link rel="prefetch" href="/assets/js/236.e632719a.js"><link rel="prefetch" href="/assets/js/237.34a70a59.js"><link rel="prefetch" href="/assets/js/238.9582b4be.js"><link rel="prefetch" href="/assets/js/239.2a1f2f8d.js"><link rel="prefetch" href="/assets/js/24.73629fb4.js"><link rel="prefetch" href="/assets/js/240.e0563eb9.js"><link rel="prefetch" href="/assets/js/241.7a2b4d6e.js"><link rel="prefetch" href="/assets/js/242.f9f59053.js"><link rel="prefetch" href="/assets/js/243.95904034.js"><link rel="prefetch" href="/assets/js/244.0c91ecaa.js"><link rel="prefetch" href="/assets/js/245.58988353.js"><link rel="prefetch" href="/assets/js/246.73360878.js"><link rel="prefetch" href="/assets/js/247.3f36cb13.js"><link rel="prefetch" href="/assets/js/248.9bca99ac.js"><link rel="prefetch" href="/assets/js/249.e78a3dbb.js"><link rel="prefetch" href="/assets/js/25.f62ba06b.js"><link rel="prefetch" href="/assets/js/250.5999a7b3.js"><link rel="prefetch" href="/assets/js/251.5204362e.js"><link rel="prefetch" href="/assets/js/252.a731f0e2.js"><link rel="prefetch" href="/assets/js/253.ef15afff.js"><link rel="prefetch" href="/assets/js/254.8e0d8aa8.js"><link rel="prefetch" href="/assets/js/255.53408731.js"><link rel="prefetch" href="/assets/js/256.3d08ae8f.js"><link rel="prefetch" href="/assets/js/257.1de6306c.js"><link rel="prefetch" href="/assets/js/258.b3ec2e6c.js"><link rel="prefetch" href="/assets/js/259.40e6c088.js"><link rel="prefetch" href="/assets/js/26.ed3d7d52.js"><link rel="prefetch" href="/assets/js/260.05ea317d.js"><link rel="prefetch" href="/assets/js/261.048af235.js"><link rel="prefetch" href="/assets/js/262.905ce2e2.js"><link rel="prefetch" href="/assets/js/263.8ace396b.js"><link rel="prefetch" href="/assets/js/264.10841fe2.js"><link rel="prefetch" href="/assets/js/265.f94f5548.js"><link rel="prefetch" href="/assets/js/266.bf7b6e06.js"><link rel="prefetch" href="/assets/js/267.4c03cbf4.js"><link rel="prefetch" href="/assets/js/268.1886e607.js"><link rel="prefetch" href="/assets/js/269.9dfca98b.js"><link rel="prefetch" href="/assets/js/27.18a2fe1c.js"><link rel="prefetch" href="/assets/js/270.a0ebdd62.js"><link rel="prefetch" href="/assets/js/271.cb9ce68b.js"><link rel="prefetch" href="/assets/js/272.99ea7c05.js"><link rel="prefetch" href="/assets/js/273.7f5c9d16.js"><link rel="prefetch" href="/assets/js/274.1ca50474.js"><link rel="prefetch" href="/assets/js/275.e0a79a93.js"><link rel="prefetch" href="/assets/js/276.5e9f441d.js"><link rel="prefetch" href="/assets/js/277.31f82a4b.js"><link rel="prefetch" href="/assets/js/278.2df5557a.js"><link rel="prefetch" href="/assets/js/279.6caef400.js"><link rel="prefetch" href="/assets/js/28.30687ae2.js"><link rel="prefetch" href="/assets/js/280.07da039a.js"><link rel="prefetch" href="/assets/js/281.81b66752.js"><link rel="prefetch" href="/assets/js/282.a362880b.js"><link rel="prefetch" href="/assets/js/283.37de8db2.js"><link rel="prefetch" href="/assets/js/284.31a9bcd5.js"><link rel="prefetch" href="/assets/js/285.e1ed9d70.js"><link rel="prefetch" href="/assets/js/286.5cd73851.js"><link rel="prefetch" href="/assets/js/287.b598b99a.js"><link rel="prefetch" href="/assets/js/288.a2580005.js"><link rel="prefetch" href="/assets/js/289.83413eb3.js"><link rel="prefetch" href="/assets/js/29.8f48fd0e.js"><link rel="prefetch" href="/assets/js/290.405974a0.js"><link rel="prefetch" href="/assets/js/291.f762f6f9.js"><link rel="prefetch" href="/assets/js/292.f5851afc.js"><link rel="prefetch" href="/assets/js/293.8e7d9ffa.js"><link rel="prefetch" href="/assets/js/294.3694f780.js"><link rel="prefetch" href="/assets/js/295.84d9cd4c.js"><link rel="prefetch" href="/assets/js/296.0a6bbe5d.js"><link rel="prefetch" href="/assets/js/297.195f8ede.js"><link rel="prefetch" href="/assets/js/3.7494bd83.js"><link rel="prefetch" href="/assets/js/30.5f000d59.js"><link rel="prefetch" href="/assets/js/31.2f3aea00.js"><link rel="prefetch" href="/assets/js/32.78912726.js"><link rel="prefetch" href="/assets/js/34.1ec8259c.js"><link rel="prefetch" href="/assets/js/35.bc414639.js"><link rel="prefetch" href="/assets/js/36.b0c05f62.js"><link rel="prefetch" href="/assets/js/37.7e626d70.js"><link rel="prefetch" href="/assets/js/38.bb3a6a22.js"><link rel="prefetch" href="/assets/js/39.3d17059f.js"><link rel="prefetch" href="/assets/js/4.ff6020d1.js"><link rel="prefetch" href="/assets/js/40.2023aaeb.js"><link rel="prefetch" href="/assets/js/41.64452f22.js"><link rel="prefetch" href="/assets/js/42.32522c9c.js"><link rel="prefetch" href="/assets/js/43.ae24bdff.js"><link rel="prefetch" href="/assets/js/44.3acc6c82.js"><link rel="prefetch" href="/assets/js/45.2cec263d.js"><link rel="prefetch" href="/assets/js/46.ceacfcd8.js"><link rel="prefetch" href="/assets/js/47.59030139.js"><link rel="prefetch" href="/assets/js/48.fa5e3c59.js"><link rel="prefetch" href="/assets/js/49.2054398b.js"><link rel="prefetch" href="/assets/js/5.f2ade644.js"><link rel="prefetch" href="/assets/js/50.47a76469.js"><link rel="prefetch" href="/assets/js/51.c36ce30b.js"><link rel="prefetch" href="/assets/js/52.72ce6650.js"><link rel="prefetch" href="/assets/js/53.9dbe65dd.js"><link rel="prefetch" href="/assets/js/54.b571c195.js"><link rel="prefetch" href="/assets/js/55.3502ffd5.js"><link rel="prefetch" href="/assets/js/56.790119c4.js"><link rel="prefetch" href="/assets/js/57.aae4081b.js"><link rel="prefetch" href="/assets/js/58.e54d1920.js"><link rel="prefetch" href="/assets/js/59.6eaa8c48.js"><link rel="prefetch" href="/assets/js/6.04d544f0.js"><link rel="prefetch" href="/assets/js/60.7b2d3e47.js"><link rel="prefetch" href="/assets/js/61.093542b8.js"><link rel="prefetch" href="/assets/js/62.d0af83fd.js"><link rel="prefetch" href="/assets/js/63.b57f13fb.js"><link rel="prefetch" href="/assets/js/64.acbb2295.js"><link rel="prefetch" href="/assets/js/65.87d05864.js"><link rel="prefetch" href="/assets/js/66.773a0404.js"><link rel="prefetch" href="/assets/js/67.c66984d0.js"><link rel="prefetch" href="/assets/js/68.77bfcb54.js"><link rel="prefetch" href="/assets/js/69.7e3d1cc4.js"><link rel="prefetch" href="/assets/js/7.bc46b052.js"><link rel="prefetch" href="/assets/js/70.dbd5eb9b.js"><link rel="prefetch" href="/assets/js/71.109923c3.js"><link rel="prefetch" href="/assets/js/72.c92d7f25.js"><link rel="prefetch" href="/assets/js/73.a8ef2055.js"><link rel="prefetch" href="/assets/js/74.79119a72.js"><link rel="prefetch" href="/assets/js/75.009bcb5e.js"><link rel="prefetch" href="/assets/js/76.cba94ffd.js"><link rel="prefetch" href="/assets/js/77.caa07e47.js"><link rel="prefetch" href="/assets/js/78.fef64e9e.js"><link rel="prefetch" href="/assets/js/79.72d6eb81.js"><link rel="prefetch" href="/assets/js/8.8cf6541b.js"><link rel="prefetch" href="/assets/js/80.9370a1bd.js"><link rel="prefetch" href="/assets/js/81.f53b6c0a.js"><link rel="prefetch" href="/assets/js/82.01861305.js"><link rel="prefetch" href="/assets/js/83.4d69c6c5.js"><link rel="prefetch" href="/assets/js/84.ea80ae96.js"><link rel="prefetch" href="/assets/js/85.34c10294.js"><link rel="prefetch" href="/assets/js/86.4c7d6d58.js"><link rel="prefetch" href="/assets/js/87.ade6c1ee.js"><link rel="prefetch" href="/assets/js/88.306bb690.js"><link rel="prefetch" href="/assets/js/89.ed02954c.js"><link rel="prefetch" href="/assets/js/9.b3d99320.js"><link rel="prefetch" href="/assets/js/90.8db20502.js"><link rel="prefetch" href="/assets/js/91.3d01b6a4.js"><link rel="prefetch" href="/assets/js/92.b3dcea87.js"><link rel="prefetch" href="/assets/js/93.28790aa5.js"><link rel="prefetch" href="/assets/js/94.45722d7d.js"><link rel="prefetch" href="/assets/js/95.c04b6585.js"><link rel="prefetch" href="/assets/js/96.7c4d9328.js"><link rel="prefetch" href="/assets/js/97.85bb6089.js"><link rel="prefetch" href="/assets/js/98.e22a9c08.js"><link rel="prefetch" href="/assets/js/99.fd9f1f1d.js">
    <link rel="stylesheet" href="/assets/css/0.styles.c17b3ac5.css">
  </head>
  <body class="theme-mode-light">
    <div id="app" data-server-rendered="true"><div class="theme-container sidebar-open have-rightmenu"><header class="navbar blur"><div title="目录" class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/logo/TB-mini.png" alt="Teng's blog" class="logo"> <span class="site-name can-hide">Teng's blog</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><a href="/note/java/" class="nav-link">Java</a></div><div class="nav-item"><a href="/note/font-end/" class="nav-link">H5前端</a></div> <a href="https://github.com/shetengteng" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar-hover-trigger"></div> <aside class="sidebar" style="display:none;"><!----> <nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><a href="/note/java/" class="nav-link">Java</a></div><div class="nav-item"><a href="/note/font-end/" class="nav-link">H5前端</a></div> <a href="https://github.com/shetengteng" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><a href="/pages/267810/" class="sidebar-link">01.项目介绍</a></li><li><a href="/pages/8daeeb/" class="sidebar-link">02.后台系统-搭建项目</a></li><li><a href="/pages/cff01b/" class="sidebar-link">03.后台系统-医院设置模块</a></li><li><a href="/pages/a0f099/" class="sidebar-link">04.后台系统-统一异常处理</a></li><li><a href="/pages/daa6e2/" class="sidebar-link">05.后台系统-统一日志处理</a></li><li><a href="/pages/9acbf4/" class="sidebar-link">06.后台系统-搭建管理后台前端</a></li><li><a href="/pages/bd4569/" class="sidebar-link">07.后台系统-医院设置前端</a></li><li><a href="/pages/ab37bc/" class="sidebar-link">08.后台系统-数据字典</a></li><li><a href="/pages/1590ab/" class="sidebar-link">09.SpringCache+Redis缓存数据</a></li><li><a href="/pages/f4f60f/" class="sidebar-link">10.集成与配置Nginx</a></li><li><a href="/pages/cfa99b/" class="sidebar-link">11.启动医院接口模拟系统</a></li><li><a href="/pages/5a3f28/" aria-current="page" class="active sidebar-link">12.后台系统-上传医院信息</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/pages/5a3f28/#service-util-中添加工具类" class="sidebar-link">service-util 中添加工具类</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/pages/5a3f28/#httputil" class="sidebar-link">HttpUtil</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#httprequesthelper" class="sidebar-link">HttpRequestHelper</a></li></ul></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#service-hosp-集成mongodb" class="sidebar-link">service-hosp 集成MongoDB</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/pages/5a3f28/#引入依赖" class="sidebar-link">引入依赖</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#添加配置" class="sidebar-link">添加配置</a></li></ul></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#在-model-添加医院基础类" class="sidebar-link">在 model 添加医院基础类</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/pages/5a3f28/#引入依赖-2" class="sidebar-link">引入依赖</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#添加-basemongoentity-基础类" class="sidebar-link">添加 BaseMongoEntity 基础类</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#添加-hospital-实体类" class="sidebar-link">添加 Hospital 实体类</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#添加-bookingrule-实体类" class="sidebar-link">添加 BookingRule 实体类</a></li></ul></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#在-service-hosp-添加医院基础类" class="sidebar-link">在 service-hosp  添加医院基础类</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/pages/5a3f28/#添加repository" class="sidebar-link">添加repository</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#添加service" class="sidebar-link">添加service</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#添加controller" class="sidebar-link">添加controller</a></li></ul></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#上传医院信息接口定义" class="sidebar-link">上传医院信息接口定义</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/pages/5a3f28/#提交地址" class="sidebar-link">提交地址</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#请求参数" class="sidebar-link">请求参数</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#同步返回" class="sidebar-link">同步返回</a></li></ul></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#上传医院信息接口实现-service-hosp" class="sidebar-link">上传医院信息接口实现 service-hosp</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/pages/5a3f28/#repository-增加实现方法" class="sidebar-link">repository 增加实现方法</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#service-增加实现方法" class="sidebar-link">service 增加实现方法</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#controller-增加实现方法" class="sidebar-link">controller 增加实现方法</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#测试上传数据" class="sidebar-link">测试上传数据</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#图片base4编码处理" class="sidebar-link">图片base4编码处理</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#添加签名校验" class="sidebar-link">添加签名校验</a></li></ul></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#查询医院信息接口定义" class="sidebar-link">查询医院信息接口定义</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/pages/5a3f28/#提交地址-2" class="sidebar-link">提交地址</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#请求参数-2" class="sidebar-link">请求参数</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#同步返回-2" class="sidebar-link">同步返回</a></li></ul></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#查询医院信息接口实现-service-hosp" class="sidebar-link">查询医院信息接口实现 service-hosp</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/pages/5a3f28/#service-增加实现方法-2" class="sidebar-link">service 增加实现方法</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#controller-增加实现方法-2" class="sidebar-link">controller 增加实现方法</a></li><li class="sidebar-sub-header"><a href="/pages/5a3f28/#测试列表" class="sidebar-link">测试列表</a></li></ul></li></ul></li><li><a href="/pages/85c8c5/" class="sidebar-link">13.后台系统-上传科室信息</a></li><li><a href="/pages/2bfc0d/" class="sidebar-link">14.后台系统-上传排班信息</a></li><li><a href="/pages/5dab7a/" class="sidebar-link">15.搭建服务注册中心Nacos</a></li><li><a href="/pages/c3a646/" class="sidebar-link">16.后台系统-医院管理</a></li><li><a href="/pages/65fa50/" class="sidebar-link">17.后台系统-排班管理</a></li><li><a href="/pages/e75b32/" class="sidebar-link">18.搭建服务网关Gateway</a></li><li><a href="/pages/3e1a3d/" class="sidebar-link">19.前台系统-搭建前端环境</a></li><li><a href="/pages/a5886b/" class="sidebar-link">20.前台系统-首页</a></li><li><a href="/pages/89220e/" class="sidebar-link">21.前台系统-医院详情页</a></li><li><a href="/pages/707098/" class="sidebar-link">22.前台系统-用户登录</a></li><li><a href="/pages/adcd3d/" class="sidebar-link">23.后台系统-短信服务</a></li><li><a href="/pages/26ab86/" class="sidebar-link">24.用户认证与网关整合</a></li><li><a href="/pages/035c93/" class="sidebar-link">25.前台系统-微信登录</a></li><li><a href="/pages/0196f4/" class="sidebar-link">26.前台系统-实名认证</a></li><li><a href="/pages/919f67/" class="sidebar-link">27.前台系统-就诊人管理</a></li><li><a href="/pages/2d8bd8/" class="sidebar-link">28.后台系统-平台用户管理</a></li><li><a href="/pages/2edc4a/" class="sidebar-link">29.前台系统-预约挂号详情</a></li><li><a href="/pages/42181a/" class="sidebar-link">30.前台系统-预约确认</a></li><li><a href="/pages/91c38e/" class="sidebar-link">31.前台系统-预约下单</a></li><li><a href="/pages/9b5903/" class="sidebar-link">32.前台系统-订单管理</a></li><li><a href="/pages/046eb0/" class="sidebar-link">33.后台系统-订单管理</a></li><li><a href="/pages/a11a73/" class="sidebar-link">34.前台系统-微信支付</a></li><li><a href="/pages/31eaca/" class="sidebar-link">35.前台系统-取消预约</a></li><li><a href="/pages/3b3641/" class="sidebar-link">36.前台系统-就医提醒</a></li><li><a href="/pages/3d23db/" class="sidebar-link">37.后台系统-预约统计</a></li><li><a href="/pages/9d4d38/" class="sidebar-link">38.小结</a></li><li><a href="/pages/1d8134/" class="sidebar-link">附录：医院接口模拟系统说明</a></li><li><a href="/pages/678e2d/" class="sidebar-link">附录：在线预约挂号API接口文档</a></li></ul> </aside> <div><main class="page"><div class="theme-vdoing-wrapper "><div class="articleInfo-wrap" data-v-0c557b5e><div class="articleInfo" data-v-0c557b5e><ul class="breadcrumbs" data-v-0c557b5e><li data-v-0c557b5e><a href="/" title="首页" class="iconfont icon-home router-link-active" data-v-0c557b5e></a></li> <li data-v-0c557b5e><span data-v-0c557b5e>Project-尚医通</span></li></ul> <div class="info" data-v-0c557b5e><div title="作者" class="author iconfont icon-touxiang" data-v-0c557b5e><a href="https://github.com/shetengteng" target="_blank" title="作者" class="beLink" data-v-0c557b5e>Shetengteng</a></div> <div title="创建时间" class="date iconfont icon-riqi" data-v-0c557b5e><a href="javascript:;" data-v-0c557b5e>2021-12-04</a></div> <!----></div></div></div> <!----> <div class="content-wrapper"><div class="right-menu-wrapper"><div class="right-menu-margin"><div class="right-menu-content"></div></div></div> <h1><!---->12.后台系统-上传医院信息<!----></h1>  <div class="theme-vdoing-content content__default"><h2 id="service-util-中添加工具类"><a href="#service-util-中添加工具类" class="header-anchor">#</a> service-util 中添加工具类</h2> <h3 id="httputil"><a href="#httputil" class="header-anchor">#</a> HttpUtil</h3> <p>创建并添加<code>com.stt.yygh.common.utils.HttpUtil</code>类如下</p> <ul><li>用于发送POST和GET请求</li></ul> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>common<span class="token punctuation">.</span>utils</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">lombok<span class="token punctuation">.</span>extern<span class="token punctuation">.</span>slf4j<span class="token punctuation">.</span></span><span class="token class-name">Slf4j</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>io<span class="token punctuation">.</span></span><span class="token operator">*</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>net<span class="token punctuation">.</span></span><span class="token class-name">HttpURLConnection</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>net<span class="token punctuation">.</span></span>URL<span class="token punctuation">;</span>

<span class="token annotation punctuation">@Slf4j</span>
<span class="token keyword">public</span> <span class="token keyword">final</span> <span class="token keyword">class</span> <span class="token class-name">HttpUtil</span> <span class="token punctuation">{</span>

	<span class="token keyword">static</span> <span class="token keyword">final</span> <span class="token class-name">String</span> POST <span class="token operator">=</span> <span class="token string">&quot;POST&quot;</span><span class="token punctuation">;</span>
	<span class="token keyword">static</span> <span class="token keyword">final</span> <span class="token class-name">String</span> GET <span class="token operator">=</span> <span class="token string">&quot;GET&quot;</span><span class="token punctuation">;</span>
	<span class="token keyword">static</span> <span class="token keyword">final</span> <span class="token keyword">int</span> CONN_TIMEOUT <span class="token operator">=</span> <span class="token number">30000</span><span class="token punctuation">;</span><span class="token comment">// ms</span>
	<span class="token keyword">static</span> <span class="token keyword">final</span> <span class="token keyword">int</span> READ_TIMEOUT <span class="token operator">=</span> <span class="token number">30000</span><span class="token punctuation">;</span><span class="token comment">// ms</span>

	<span class="token comment">/**
	 * post 方式发送http请求.
	 * 
	 * @param strUrl
	 * @param reqData
	 * @return
	 */</span>
	<span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token function">doPost</span><span class="token punctuation">(</span><span class="token class-name">String</span> strUrl<span class="token punctuation">,</span> <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> reqData<span class="token punctuation">)</span> <span class="token punctuation">{</span>
		<span class="token keyword">return</span> <span class="token function">send</span><span class="token punctuation">(</span>strUrl<span class="token punctuation">,</span> POST<span class="token punctuation">,</span> reqData<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>

	<span class="token comment">/**
	 * get方式发送http请求.
	 * 
	 * @param strUrl
	 * @return
	 */</span>
	<span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token function">doGet</span><span class="token punctuation">(</span><span class="token class-name">String</span> strUrl<span class="token punctuation">)</span> <span class="token punctuation">{</span>
		<span class="token keyword">return</span> <span class="token function">send</span><span class="token punctuation">(</span>strUrl<span class="token punctuation">,</span> GET<span class="token punctuation">,</span> <span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>

	<span class="token comment">/**
	 * @param strUrl
	 * @param reqmethod
	 * @param reqData
	 * @return
	 */</span>
	<span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token function">send</span><span class="token punctuation">(</span><span class="token class-name">String</span> strUrl<span class="token punctuation">,</span> <span class="token class-name">String</span> reqmethod<span class="token punctuation">,</span> <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> reqData<span class="token punctuation">)</span> <span class="token punctuation">{</span>
		<span class="token keyword">try</span> <span class="token punctuation">{</span>
			<span class="token class-name">URL</span> url <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token function">URL</span><span class="token punctuation">(</span>strUrl<span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token class-name">HttpURLConnection</span> httpcon <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token class-name">HttpURLConnection</span><span class="token punctuation">)</span> url<span class="token punctuation">.</span><span class="token function">openConnection</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			httpcon<span class="token punctuation">.</span><span class="token function">setDoOutput</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			httpcon<span class="token punctuation">.</span><span class="token function">setDoInput</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			httpcon<span class="token punctuation">.</span><span class="token function">setUseCaches</span><span class="token punctuation">(</span><span class="token boolean">false</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			httpcon<span class="token punctuation">.</span><span class="token function">setInstanceFollowRedirects</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			httpcon<span class="token punctuation">.</span><span class="token function">setConnectTimeout</span><span class="token punctuation">(</span>CONN_TIMEOUT<span class="token punctuation">)</span><span class="token punctuation">;</span>
			httpcon<span class="token punctuation">.</span><span class="token function">setReadTimeout</span><span class="token punctuation">(</span>READ_TIMEOUT<span class="token punctuation">)</span><span class="token punctuation">;</span>
			httpcon<span class="token punctuation">.</span><span class="token function">setRequestMethod</span><span class="token punctuation">(</span>reqmethod<span class="token punctuation">)</span><span class="token punctuation">;</span>
			httpcon<span class="token punctuation">.</span><span class="token function">connect</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token keyword">if</span> <span class="token punctuation">(</span>reqmethod<span class="token punctuation">.</span><span class="token function">equalsIgnoreCase</span><span class="token punctuation">(</span>POST<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
				<span class="token class-name">OutputStream</span> os <span class="token operator">=</span> httpcon<span class="token punctuation">.</span><span class="token function">getOutputStream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
				os<span class="token punctuation">.</span><span class="token function">write</span><span class="token punctuation">(</span>reqData<span class="token punctuation">)</span><span class="token punctuation">;</span>
				os<span class="token punctuation">.</span><span class="token function">flush</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
				os<span class="token punctuation">.</span><span class="token function">close</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token punctuation">}</span>
			<span class="token class-name">BufferedReader</span> in <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">BufferedReader</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">InputStreamReader</span><span class="token punctuation">(</span>httpcon<span class="token punctuation">.</span><span class="token function">getInputStream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token string">&quot;utf-8&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token class-name">String</span> inputLine<span class="token punctuation">;</span>
			<span class="token class-name">StringBuilder</span> bankXmlBuffer <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">StringBuilder</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token keyword">while</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>inputLine <span class="token operator">=</span> in<span class="token punctuation">.</span><span class="token function">readLine</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">!=</span> <span class="token keyword">null</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>  
			    bankXmlBuffer<span class="token punctuation">.</span><span class="token function">append</span><span class="token punctuation">(</span>inputLine<span class="token punctuation">)</span><span class="token punctuation">;</span>  
			<span class="token punctuation">}</span>  
			in<span class="token punctuation">.</span><span class="token function">close</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>  
			httpcon<span class="token punctuation">.</span><span class="token function">disconnect</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token keyword">return</span> bankXmlBuffer<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getBytes</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span><span class="token class-name">Exception</span> ex<span class="token punctuation">)</span> <span class="token punctuation">{</span>
			log<span class="token punctuation">.</span><span class="token function">error</span><span class="token punctuation">(</span>ex<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> ex<span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token keyword">return</span> <span class="token keyword">null</span><span class="token punctuation">;</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
	
	<span class="token comment">/**
	 * 从输入流中读取数据
	 * 
	 * @param inStream
	 * @return
	 * @throws Exception
	 */</span>
	<span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token function">readInputStream</span><span class="token punctuation">(</span><span class="token class-name">InputStream</span> inStream<span class="token punctuation">)</span> <span class="token keyword">throws</span> <span class="token class-name">Exception</span> <span class="token punctuation">{</span>
		<span class="token class-name">ByteArrayOutputStream</span> outStream <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">ByteArrayOutputStream</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> buffer <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token number">1024</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> len <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token keyword">while</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>len <span class="token operator">=</span> inStream<span class="token punctuation">.</span><span class="token function">read</span><span class="token punctuation">(</span>buffer<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">!=</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
			outStream<span class="token punctuation">.</span><span class="token function">write</span><span class="token punctuation">(</span>buffer<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> len<span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token punctuation">}</span>
		<span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> data <span class="token operator">=</span> outStream<span class="token punctuation">.</span><span class="token function">toByteArray</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">// 网页的二进制数据</span>
		outStream<span class="token punctuation">.</span><span class="token function">close</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		inStream<span class="token punctuation">.</span><span class="token function">close</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">return</span> data<span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br><span class="line-number">87</span><br><span class="line-number">88</span><br><span class="line-number">89</span><br><span class="line-number">90</span><br><span class="line-number">91</span><br><span class="line-number">92</span><br><span class="line-number">93</span><br><span class="line-number">94</span><br><span class="line-number">95</span><br><span class="line-number">96</span><br></div></div><h3 id="httprequesthelper"><a href="#httprequesthelper" class="header-anchor">#</a> HttpRequestHelper</h3> <p>创建并添加 <code>com.stt.yygh.common.helper.HttpRequestHelper</code> 类</p> <ul><li>封装请求，解析请求中的json信息以及验证签名</li></ul> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>common<span class="token punctuation">.</span>helper</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>alibaba<span class="token punctuation">.</span>fastjson<span class="token punctuation">.</span></span><span class="token class-name">JSONObject</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>common<span class="token punctuation">.</span>utils<span class="token punctuation">.</span></span><span class="token class-name">HttpUtil</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>common<span class="token punctuation">.</span>utils<span class="token punctuation">.</span></span>MD5<span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">lombok<span class="token punctuation">.</span>extern<span class="token punctuation">.</span>slf4j<span class="token punctuation">.</span></span><span class="token class-name">Slf4j</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">Date</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">HashMap</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">Map</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">TreeMap</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Slf4j</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">HttpRequestHelper</span> <span class="token punctuation">{</span>

    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> paramMap <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">HashMap</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token punctuation">&gt;</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        paramMap<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span><span class="token string">&quot;d&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;4&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        paramMap<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span><span class="token string">&quot;b&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;2&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        paramMap<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span><span class="token string">&quot;c&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;3&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        paramMap<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span><span class="token string">&quot;a&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        paramMap<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span><span class="token string">&quot;timestamp&quot;</span><span class="token punctuation">,</span> <span class="token function">getTimestamp</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        log<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token function">getSign</span><span class="token punctuation">(</span>paramMap<span class="token punctuation">,</span> <span class="token string">&quot;111111111&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     *
     * @param paramMap
     * @return
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> <span class="token function">switchMap</span><span class="token punctuation">(</span><span class="token class-name">Map</span><span class="token operator">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token operator">&gt;</span> paramMap<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> resultMap <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">HashMap</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token punctuation">&gt;</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token class-name">Map<span class="token punctuation">.</span>Entry</span><span class="token operator">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token operator">&gt;</span> param <span class="token operator">:</span> paramMap<span class="token punctuation">.</span><span class="token function">entrySet</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            resultMap<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span>param<span class="token punctuation">.</span><span class="token function">getKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> param<span class="token punctuation">.</span><span class="token function">getValue</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        <span class="token keyword">return</span> resultMap<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     * 请求数据获取签名
     * @param paramMap
     * @param signKey
     * @return
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token class-name">String</span> <span class="token function">getSign</span><span class="token punctuation">(</span><span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> paramMap<span class="token punctuation">,</span> <span class="token class-name">String</span> signKey<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">if</span><span class="token punctuation">(</span>paramMap<span class="token punctuation">.</span><span class="token function">containsKey</span><span class="token punctuation">(</span><span class="token string">&quot;sign&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            paramMap<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token string">&quot;sign&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        <span class="token class-name">TreeMap</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> sorted <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">TreeMap</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token punctuation">&gt;</span></span><span class="token punctuation">(</span>paramMap<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token class-name">StringBuilder</span> str <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">StringBuilder</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token class-name">Map<span class="token punctuation">.</span>Entry</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> param <span class="token operator">:</span> sorted<span class="token punctuation">.</span><span class="token function">entrySet</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            str<span class="token punctuation">.</span><span class="token function">append</span><span class="token punctuation">(</span>param<span class="token punctuation">.</span><span class="token function">getValue</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">append</span><span class="token punctuation">(</span><span class="token string">&quot;|&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        str<span class="token punctuation">.</span><span class="token function">append</span><span class="token punctuation">(</span>signKey<span class="token punctuation">)</span><span class="token punctuation">;</span>
        log<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">&quot;加密前：&quot;</span> <span class="token operator">+</span> str<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token class-name">String</span> md5Str <span class="token operator">=</span> MD5<span class="token punctuation">.</span><span class="token function">encrypt</span><span class="token punctuation">(</span>str<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        log<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">&quot;加密后：&quot;</span> <span class="token operator">+</span> md5Str<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">return</span> md5Str<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     * 签名校验
     * @param paramMap
     * @param signKey
     * @return
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">boolean</span> <span class="token function">isSignEquals</span><span class="token punctuation">(</span><span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> paramMap<span class="token punctuation">,</span> <span class="token class-name">String</span> signKey<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token class-name">String</span> sign <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">)</span>paramMap<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">&quot;sign&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token class-name">String</span> md5Str <span class="token operator">=</span> <span class="token function">getSign</span><span class="token punctuation">(</span>paramMap<span class="token punctuation">,</span> signKey<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>sign<span class="token punctuation">.</span><span class="token function">equals</span><span class="token punctuation">(</span>md5Str<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        <span class="token keyword">return</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     * 获取时间戳
     * @return
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">long</span> <span class="token function">getTimestamp</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">return</span> <span class="token keyword">new</span> <span class="token class-name">Date</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getTime</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">/**
     * 封装同步请求
     * @param paramMap
     * @param url
     * @return
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token class-name">JSONObject</span> <span class="token function">sendRequest</span><span class="token punctuation">(</span><span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> paramMap<span class="token punctuation">,</span> <span class="token class-name">String</span> url<span class="token punctuation">)</span><span class="token punctuation">{</span>
        <span class="token class-name">String</span> result <span class="token operator">=</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">;</span>
        <span class="token keyword">try</span> <span class="token punctuation">{</span>
            <span class="token comment">//封装post参数</span>
            <span class="token class-name">StringBuilder</span> postdata <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">StringBuilder</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token class-name">Map<span class="token punctuation">.</span>Entry</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> param <span class="token operator">:</span> paramMap<span class="token punctuation">.</span><span class="token function">entrySet</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                postdata<span class="token punctuation">.</span><span class="token function">append</span><span class="token punctuation">(</span>param<span class="token punctuation">.</span><span class="token function">getKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">append</span><span class="token punctuation">(</span><span class="token string">&quot;=&quot;</span><span class="token punctuation">)</span>
                        <span class="token punctuation">.</span><span class="token function">append</span><span class="token punctuation">(</span>param<span class="token punctuation">.</span><span class="token function">getValue</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">append</span><span class="token punctuation">(</span><span class="token string">&quot;&amp;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            log<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">.</span><span class="token function">format</span><span class="token punctuation">(</span><span class="token string">&quot;--&gt; 发送请求：post data %1s&quot;</span><span class="token punctuation">,</span> postdata<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> reqData <span class="token operator">=</span> postdata<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getBytes</span><span class="token punctuation">(</span><span class="token string">&quot;utf-8&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> respdata <span class="token operator">=</span> <span class="token class-name">HttpUtil</span><span class="token punctuation">.</span><span class="token function">doPost</span><span class="token punctuation">(</span>url<span class="token punctuation">,</span>reqData<span class="token punctuation">)</span><span class="token punctuation">;</span>
            result <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">String</span><span class="token punctuation">(</span>respdata<span class="token punctuation">)</span><span class="token punctuation">;</span>
            log<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">.</span><span class="token function">format</span><span class="token punctuation">(</span><span class="token string">&quot;--&gt; 应答结果：result data %1s&quot;</span><span class="token punctuation">,</span> result<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span><span class="token class-name">Exception</span> ex<span class="token punctuation">)</span> <span class="token punctuation">{</span>
            ex<span class="token punctuation">.</span><span class="token function">printStackTrace</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        <span class="token keyword">return</span> <span class="token class-name">JSONObject</span><span class="token punctuation">.</span><span class="token function">parseObject</span><span class="token punctuation">(</span>result<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br><span class="line-number">87</span><br><span class="line-number">88</span><br><span class="line-number">89</span><br><span class="line-number">90</span><br><span class="line-number">91</span><br><span class="line-number">92</span><br><span class="line-number">93</span><br><span class="line-number">94</span><br><span class="line-number">95</span><br><span class="line-number">96</span><br><span class="line-number">97</span><br><span class="line-number">98</span><br><span class="line-number">99</span><br><span class="line-number">100</span><br><span class="line-number">101</span><br><span class="line-number">102</span><br><span class="line-number">103</span><br><span class="line-number">104</span><br><span class="line-number">105</span><br><span class="line-number">106</span><br><span class="line-number">107</span><br><span class="line-number">108</span><br><span class="line-number">109</span><br></div></div><h2 id="service-hosp-集成mongodb"><a href="#service-hosp-集成mongodb" class="header-anchor">#</a> service-hosp 集成MongoDB</h2> <div class="custom-block tip"><p class="custom-block-title">提示</p> <p>如果已经掌握，可以忽略</p></div> <div class="cardListContainer"><div class="card-list"><a href="/pages/f3cf88/" target="_blank" class="card-item row-1" style="background-color:#DFEEE7;--random-color:#DFEEE7;color:#2A3344;"><div><p class="name">🚀 MongoDB入门使用</p> <p class="desc">重点关注在SpringBoot集成中关于MongoDB的使用</p></div></a></div><div class="language-yaml line-numbers-mode"><pre class="language-yaml"><code><span class="token punctuation">-</span> <span class="token key atrule">name</span><span class="token punctuation">:</span> 🚀 MongoDB入门使用
  <span class="token key atrule">desc</span><span class="token punctuation">:</span> <span class="token string">'重点关注在SpringBoot集成中关于MongoDB的使用'</span>
  <span class="token key atrule">link</span><span class="token punctuation">:</span> /pages/f3cf88/
  <span class="token key atrule">bgColor</span><span class="token punctuation">:</span> <span class="token string">'#DFEEE7'</span>
  <span class="token key atrule">textColor</span><span class="token punctuation">:</span> <span class="token string">'#2A3344'</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div></div><h3 id="引入依赖"><a href="#引入依赖" class="header-anchor">#</a> 引入依赖</h3> <p>在 <code>service-hosp</code> 模块的pom中添加依赖</p> <div class="language-xml line-numbers-mode"><pre class="language-xml"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-starter-data-mongodb<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h3 id="添加配置"><a href="#添加配置" class="header-anchor">#</a> 添加配置</h3> <p>在 application.properties中添加如下配置，修改为自己的配置地址</p> <div class="language-properties line-numbers-mode"><pre class="language-properties"><code><span class="token comment">#mongodb地址</span>
<span class="token attr-name">spring.data.mongodb.host</span><span class="token punctuation">=</span><span class="token attr-value">localhost</span>
<span class="token attr-name">spring.data.mongodb.port</span><span class="token punctuation">=</span><span class="token attr-value">27017</span>
<span class="token attr-name">spring.data.mongodb.database</span><span class="token punctuation">=</span><span class="token attr-value">yygh_hosp</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h2 id="在-model-添加医院基础类"><a href="#在-model-添加医院基础类" class="header-anchor">#</a> 在 model 添加医院基础类</h2> <h3 id="引入依赖-2"><a href="#引入依赖-2" class="header-anchor">#</a> 引入依赖</h3> <p>在pom文件中引入 mongodb依赖，注意scope 为 provided</p> <div class="language-xml line-numbers-mode"><pre class="language-xml"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-starter-data-mongodb<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>scope</span><span class="token punctuation">&gt;</span></span>provided<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>scope</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><h3 id="添加-basemongoentity-基础类"><a href="#添加-basemongoentity-基础类" class="header-anchor">#</a> 添加 <code>BaseMongoEntity</code> 基础类</h3> <p>在<code>model</code>模块中创建并添加 <code>com.stt.yygh.model.base.BaseMongoEntity</code>
用于所有MongoDB实体类对象继承的父类，包含id，创建时间以及更新时间等公共字段</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>model<span class="token punctuation">.</span>base</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>baomidou<span class="token punctuation">.</span>mybatisplus<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">IdType</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>baomidou<span class="token punctuation">.</span>mybatisplus<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">TableField</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>baomidou<span class="token punctuation">.</span>mybatisplus<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">TableId</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>baomidou<span class="token punctuation">.</span>mybatisplus<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">TableLogic</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">io<span class="token punctuation">.</span>swagger<span class="token punctuation">.</span>annotations<span class="token punctuation">.</span></span><span class="token class-name">ApiModelProperty</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>data<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">Id</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">lombok<span class="token punctuation">.</span></span><span class="token class-name">Data</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>data<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">Transient</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>io<span class="token punctuation">.</span></span><span class="token class-name">Serializable</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">Date</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">HashMap</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">Map</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Data</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">BaseMongoEntity</span> <span class="token keyword">implements</span> <span class="token class-name">Serializable</span> <span class="token punctuation">{</span>

    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;id&quot;</span><span class="token punctuation">)</span>
    <span class="token annotation punctuation">@Id</span>
    <span class="token keyword">private</span> <span class="token class-name">String</span> id<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;创建时间&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">private</span> <span class="token class-name">Date</span> createTime<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;更新时间&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">private</span> <span class="token class-name">Date</span> updateTime<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;逻辑删除(1:已删除，0:未删除)&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">private</span> <span class="token class-name">Integer</span> isDeleted<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;其他参数&quot;</span><span class="token punctuation">)</span>
    <span class="token annotation punctuation">@Transient</span> <span class="token comment">//被该注解标注的，将不会被录入到数据库中。只作为普通的javaBean属性</span>
    <span class="token keyword">private</span> <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span><span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> param <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">HashMap</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token punctuation">&gt;</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br></div></div><h3 id="添加-hospital-实体类"><a href="#添加-hospital-实体类" class="header-anchor">#</a> 添加 <code>Hospital</code> 实体类</h3> <p>在<code>model</code>中添加 <code>com.stt.yygh.model.hosp.Hospital</code> 实体类，继承 <code>BaseMongoEntity</code> 公共类</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>model<span class="token punctuation">.</span>hosp</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>alibaba<span class="token punctuation">.</span>fastjson<span class="token punctuation">.</span></span><span class="token class-name">JSONObject</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>model<span class="token punctuation">.</span>base<span class="token punctuation">.</span></span><span class="token class-name">BaseMongoEntity</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">io<span class="token punctuation">.</span>swagger<span class="token punctuation">.</span>annotations<span class="token punctuation">.</span></span><span class="token class-name">ApiModel</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">io<span class="token punctuation">.</span>swagger<span class="token punctuation">.</span>annotations<span class="token punctuation">.</span></span><span class="token class-name">ApiModelProperty</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">lombok<span class="token punctuation">.</span></span><span class="token class-name">Data</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>data<span class="token punctuation">.</span>mongodb<span class="token punctuation">.</span>core<span class="token punctuation">.</span>index<span class="token punctuation">.</span></span><span class="token class-name">Indexed</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>data<span class="token punctuation">.</span>mongodb<span class="token punctuation">.</span>core<span class="token punctuation">.</span>mapping<span class="token punctuation">.</span></span><span class="token class-name">Document</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Data</span>
<span class="token annotation punctuation">@ApiModel</span><span class="token punctuation">(</span>description <span class="token operator">=</span> <span class="token string">&quot;Hospital&quot;</span><span class="token punctuation">)</span>
<span class="token annotation punctuation">@Document</span><span class="token punctuation">(</span><span class="token string">&quot;Hospital&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Hospital</span> <span class="token keyword">extends</span> <span class="token class-name">BaseMongoEntity</span> <span class="token punctuation">{</span>
	<span class="token keyword">private</span> <span class="token keyword">static</span> <span class="token keyword">final</span> <span class="token keyword">long</span> serialVersionUID <span class="token operator">=</span> <span class="token number">1L</span><span class="token punctuation">;</span>
	
	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;医院编号&quot;</span><span class="token punctuation">)</span>
	<span class="token annotation punctuation">@Indexed</span><span class="token punctuation">(</span>unique <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">)</span> <span class="token comment">//唯一索引</span>
	<span class="token keyword">private</span> <span class="token class-name">String</span> hoscode<span class="token punctuation">;</span>

	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;医院名称&quot;</span><span class="token punctuation">)</span>
	<span class="token annotation punctuation">@Indexed</span> <span class="token comment">//普通索引</span>
	<span class="token keyword">private</span> <span class="token class-name">String</span> hosname<span class="token punctuation">;</span>

	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;医院类型&quot;</span><span class="token punctuation">)</span>
	<span class="token keyword">private</span> <span class="token class-name">String</span> hostype<span class="token punctuation">;</span>

	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;省code&quot;</span><span class="token punctuation">)</span>
	<span class="token keyword">private</span> <span class="token class-name">String</span> provinceCode<span class="token punctuation">;</span>

	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;市code&quot;</span><span class="token punctuation">)</span>
	<span class="token keyword">private</span> <span class="token class-name">String</span> cityCode<span class="token punctuation">;</span>

	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;区code&quot;</span><span class="token punctuation">)</span>
	<span class="token keyword">private</span> <span class="token class-name">String</span> districtCode<span class="token punctuation">;</span>

	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;详情地址&quot;</span><span class="token punctuation">)</span>
	<span class="token keyword">private</span> <span class="token class-name">String</span> address<span class="token punctuation">;</span>

	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;医院logo&quot;</span><span class="token punctuation">)</span>
	<span class="token keyword">private</span> <span class="token class-name">String</span> logoData<span class="token punctuation">;</span>

	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;医院简介&quot;</span><span class="token punctuation">)</span>
	<span class="token keyword">private</span> <span class="token class-name">String</span> intro<span class="token punctuation">;</span>

	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;坐车路线&quot;</span><span class="token punctuation">)</span>
	<span class="token keyword">private</span> <span class="token class-name">String</span> route<span class="token punctuation">;</span>

	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;状态 0：未上线 1：已上线&quot;</span><span class="token punctuation">)</span>
	<span class="token keyword">private</span> <span class="token class-name">Integer</span> status<span class="token punctuation">;</span>

	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;预约规则&quot;</span><span class="token punctuation">)</span>
	<span class="token keyword">private</span> <span class="token class-name">BookingRule</span> bookingRule<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br></div></div><h3 id="添加-bookingrule-实体类"><a href="#添加-bookingrule-实体类" class="header-anchor">#</a> 添加 <code>BookingRule</code> 实体类</h3> <p>在<code>model</code>中添加 <code>com.stt.yygh.model.hosp.BookingRule</code> 实体类，继承 <code>BaseMongoEntity</code> 公共类
该类被用于<code>Hospital</code> 中的嵌套字段使用</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>model<span class="token punctuation">.</span>hosp</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>alibaba<span class="token punctuation">.</span>fastjson<span class="token punctuation">.</span></span><span class="token class-name">JSONArray</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">io<span class="token punctuation">.</span>swagger<span class="token punctuation">.</span>annotations<span class="token punctuation">.</span></span><span class="token class-name">ApiModel</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">io<span class="token punctuation">.</span>swagger<span class="token punctuation">.</span>annotations<span class="token punctuation">.</span></span><span class="token class-name">ApiModelProperty</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">lombok<span class="token punctuation">.</span></span><span class="token class-name">Data</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>data<span class="token punctuation">.</span>mongodb<span class="token punctuation">.</span>core<span class="token punctuation">.</span>mapping<span class="token punctuation">.</span></span><span class="token class-name">Document</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">StringUtils</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">List</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Data</span>
<span class="token annotation punctuation">@ApiModel</span><span class="token punctuation">(</span>description <span class="token operator">=</span> <span class="token string">&quot;预约规则&quot;</span><span class="token punctuation">)</span>
<span class="token annotation punctuation">@Document</span><span class="token punctuation">(</span><span class="token string">&quot;BookingRule&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">BookingRule</span> <span class="token punctuation">{</span>

    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;预约周期&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">private</span> <span class="token class-name">Integer</span> cycle<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;放号时间&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">private</span> <span class="token class-name">String</span> releaseTime<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;停挂时间&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">private</span> <span class="token class-name">String</span> stopTime<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;退号截止天数（如：就诊前一天为-1，当天为0）&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">private</span> <span class="token class-name">Integer</span> quitDay<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;退号时间&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">private</span> <span class="token class-name">String</span> quitTime<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;预约规则&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">private</span> <span class="token class-name">List</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">&gt;</span></span> rule<span class="token punctuation">;</span>

    <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">setRule</span><span class="token punctuation">(</span><span class="token class-name">String</span> rule<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span><span class="token class-name">StringUtils</span><span class="token punctuation">.</span><span class="token function">isEmpty</span><span class="token punctuation">(</span>rule<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">this</span><span class="token punctuation">.</span>rule <span class="token operator">=</span> <span class="token class-name">JSONArray</span><span class="token punctuation">.</span><span class="token function">parseArray</span><span class="token punctuation">(</span>rule<span class="token punctuation">,</span> <span class="token class-name">String</span><span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br></div></div><h2 id="在-service-hosp-添加医院基础类"><a href="#在-service-hosp-添加医院基础类" class="header-anchor">#</a> 在 service-hosp  添加医院基础类</h2> <h3 id="添加repository"><a href="#添加repository" class="header-anchor">#</a> 添加repository</h3> <p>在<code>service-hosp</code>中创建并添加  HospitalRepository 类</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>repository</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>model<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span></span><span class="token class-name">Hospital</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>data<span class="token punctuation">.</span>mongodb<span class="token punctuation">.</span>repository<span class="token punctuation">.</span></span><span class="token class-name">MongoRepository</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>stereotype<span class="token punctuation">.</span></span><span class="token class-name">Repository</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Repository</span>
<span class="token keyword">public</span> <span class="token keyword">interface</span> <span class="token class-name">HospitalRepository</span> <span class="token keyword">extends</span> <span class="token class-name">MongoRepository</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">Hospital</span><span class="token punctuation">,</span><span class="token class-name">String</span><span class="token punctuation">&gt;</span></span> <span class="token punctuation">{</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div><h3 id="添加service"><a href="#添加service" class="header-anchor">#</a> 添加service</h3> <p>在<code>service-hosp</code>中创建并添加  HospitalService 接口</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>service</span><span class="token punctuation">;</span>

<span class="token keyword">public</span> <span class="token keyword">interface</span> <span class="token class-name">HospitalService</span> <span class="token punctuation">{</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><p>在<code>service-hosp</code>中创建并添加  HospitalServiceImpl  实现类</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>service<span class="token punctuation">.</span>impl</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>repository<span class="token punctuation">.</span></span><span class="token class-name">HospitalRepository</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>service<span class="token punctuation">.</span></span><span class="token class-name">HospitalService</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>beans<span class="token punctuation">.</span>factory<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">Autowired</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>stereotype<span class="token punctuation">.</span></span><span class="token class-name">Service</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Service</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">HospitalServiceImpl</span> <span class="token keyword">implements</span> <span class="token class-name">HospitalService</span> <span class="token punctuation">{</span>

    <span class="token annotation punctuation">@Autowired</span>
    <span class="token keyword">private</span> <span class="token class-name">HospitalRepository</span> repository<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br></div></div><h3 id="添加controller"><a href="#添加controller" class="header-anchor">#</a> 添加controller</h3> <blockquote><p>平台对外开发的接口都写在该Controller类</p></blockquote> <p>在<code>service-hosp</code>中创建并添加  ApiController 实现类</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>controller</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>service<span class="token punctuation">.</span></span><span class="token class-name">HospitalService</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">io<span class="token punctuation">.</span>swagger<span class="token punctuation">.</span>annotations<span class="token punctuation">.</span></span><span class="token class-name">Api</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>beans<span class="token punctuation">.</span>factory<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">Autowired</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>web<span class="token punctuation">.</span>bind<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">RequestMapping</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>web<span class="token punctuation">.</span>bind<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">RestController</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Api</span><span class="token punctuation">(</span>tags <span class="token operator">=</span> <span class="token string">&quot;医院管理API接口&quot;</span><span class="token punctuation">)</span>
<span class="token annotation punctuation">@RestController</span>
<span class="token annotation punctuation">@RequestMapping</span><span class="token punctuation">(</span><span class="token string">&quot;/api/hosp&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">ApiController</span> <span class="token punctuation">{</span>

    <span class="token annotation punctuation">@Autowired</span>
    <span class="token keyword">private</span> <span class="token class-name">HospitalService</span> hospitalService<span class="token punctuation">;</span>
    
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br></div></div><h2 id="上传医院信息接口定义"><a href="#上传医院信息接口定义" class="header-anchor">#</a> 上传医院信息接口定义</h2> <p>参考 <a href="/pages/678e2d/#上传医院">附录：在线预约挂号API接口文档</a> 平台接口 &gt; 上传医院</p> <p>注意</p> <ul><li><p>医院编号是平台分配的，全局唯一</p></li> <li><p>上传医院接口可以多次调用，如果存在<strong>相同编号的为更新操作</strong></p></li></ul> <h3 id="提交地址"><a href="#提交地址" class="header-anchor">#</a> 提交地址</h3> <p>http://localhost/api/hosp/saveHospital</p> <h3 id="请求参数"><a href="#请求参数" class="header-anchor">#</a> 请求参数</h3> <p>变量定义</p> <table><thead><tr><th>字段名</th> <th><strong>类型</strong></th> <th><strong>长度</strong></th> <th><strong>必输</strong></th> <th><strong>说明</strong></th></tr></thead> <tbody><tr><td>hoscode</td> <td>string</td> <td>30</td> <td>是</td> <td>给医院分配的唯一标识</td></tr> <tr><td>hosname</td> <td>string</td> <td>50</td> <td>是</td> <td>医院名称</td></tr> <tr><td>hostype</td> <td>string</td> <td>1</td> <td>是</td> <td>医院类型(1:三级甲等,2:三级乙等,3:二级甲等,4:二级乙等,5:一级)</td></tr> <tr><td>provinceCode</td> <td>string</td> <td>18</td> <td>是</td> <td>省code（国家统计局对应省的code）</td></tr> <tr><td>cityCode</td> <td>string</td> <td>50</td> <td>是</td> <td>市code（国家统计局对应市的code）</td></tr> <tr><td>districtCode</td> <td>string</td> <td>10</td> <td>是</td> <td>区code（国家统计局对应区的code）</td></tr> <tr><td>address</td> <td>string</td> <td>20</td> <td>是</td> <td>详情地址</td></tr> <tr><td>logoData</td> <td>string</td> <td>11</td> <td>是</td> <td>医院logo(转换为base64字符串)</td></tr> <tr><td>intro</td> <td>string</td> <td></td> <td>是</td> <td>医院简介</td></tr> <tr><td>route</td> <td>string</td> <td>255</td> <td>是</td> <td>坐车路线</td></tr> <tr><td>bookingRule</td> <td>string</td> <td>8000</td> <td>是</td> <td>预约规则，json数据</td></tr> <tr><td>timestamp</td> <td>long</td> <td></td> <td>是</td> <td>时间戳。从1970-01-01 00:00:00算起的毫秒数</td></tr> <tr><td>sign</td> <td>string</td> <td>32</td> <td>是</td> <td>验签参数。</td></tr></tbody></table> <p>关于 bookingRule</p> <ul><li>属性说明
<ul><li>cycle：预约周期</li> <li>releaseTime：放号时间</li> <li>stopTime：停挂时间</li> <li>quitDay：退号截止天数</li> <li>如：就诊前一天为-1，当天为0</li> <li>quitTime：退号时间    rule：预约规则，以数组形式传递</li></ul></li> <li>例子</li></ul> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;cycle&quot;</span><span class="token operator">:</span>  <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;releaseTime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;08:30&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;stopTime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;11:30&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;quitDay&quot;</span><span class="token operator">:</span> <span class="token string">&quot;-1&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;quitTime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;15:30&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;rule&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span> 
        <span class="token string">&quot;西院区预约号取号地点：西院区门诊楼一层大厅挂号窗口取号&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;东院区预约号取号地点：东院区老门诊楼一层大厅挂号窗口或新门诊楼各楼层挂号/收费窗口取号&quot;</span> 
    <span class="token punctuation">]</span>
<span class="token punctuation">}</span> 
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><p>完整的请求参数</p> <ul><li>数据分为<strong>医院基本信息</strong>与<strong>预约规则信息</strong></li> <li>医院logo转换为base64字符串</li> <li>预约规则信息属于医院基本信息的一个属性</li> <li>预约规则rule，以数组形式传递</li> <li>数据传递之后需要验证签名，只允许平台开通的医院可以上传数据，保证数据安全性</li></ul> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;hoscode&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1000_0&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;hosname&quot;</span><span class="token operator">:</span> <span class="token string">&quot;北京协和医院&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;hostype&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;provinceCode&quot;</span><span class="token operator">:</span> <span class="token string">&quot;110000&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;cityCode&quot;</span><span class="token operator">:</span> <span class="token string">&quot;110100&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;districtCode&quot;</span><span class="token operator">:</span> <span class="token string">&quot;110102&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;address&quot;</span><span class="token operator">:</span> <span class="token string">&quot;大望路&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;intro&quot;</span><span class="token operator">:</span> <span class="token string">&quot;北京协和医院是集医疗、教学、科研于一体的大型三级甲等综合医院，是国家卫生计生委...目标而继续努力。&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;route&quot;</span><span class="token operator">:</span> <span class="token string">&quot;东院区乘车路线：106、...更多乘车路线详见须知。&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;logoData&quot;</span><span class="token operator">:</span> <span class="token string">&quot;iVBORw0KGgoAAAA...NSUhEUg==&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;bookingRule&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">&quot;cycle&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;releaseTime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;08:30&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;stopTime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;11:30&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;quitDay&quot;</span><span class="token operator">:</span> <span class="token string">&quot;-1&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;quitTime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;15:30&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;rule&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            <span class="token string">&quot;西院区预约号取号地点：西院区门诊楼一层大厅挂号窗口取号&quot;</span><span class="token punctuation">,</span>
            <span class="token string">&quot;东院区预约号取号地点：东院区老门诊楼一层大厅挂号窗口或新门诊楼各楼层挂号/收费窗口取号&quot;</span>
        <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br></div></div><h3 id="同步返回"><a href="#同步返回" class="header-anchor">#</a> 同步返回</h3> <p>结果参数含义</p> <table><thead><tr><th><strong>字段名</strong></th> <th><strong>类型</strong></th> <th><strong>长度</strong></th> <th><strong>必输</strong></th> <th><strong>说明</strong></th></tr></thead> <tbody><tr><td>code</td> <td>string</td> <td></td> <td>是</td> <td>结果编码 <br>200：请求成功<br>不等于200：请求失败</td></tr> <tr><td>message</td> <td>string</td> <td>100</td> <td>是</td> <td>结果描述 or 失败原因</td></tr> <tr><td>data</td> <td>string</td> <td>5000</td> <td>是</td> <td>业务数据</td></tr></tbody></table> <h2 id="上传医院信息接口实现-service-hosp"><a href="#上传医院信息接口实现-service-hosp" class="header-anchor">#</a> 上传医院信息接口实现 service-hosp</h2> <h3 id="repository-增加实现方法"><a href="#repository-增加实现方法" class="header-anchor">#</a> repository 增加实现方法</h3> <p>对于MongoRepository 只需要声明指定规则的方法，框架会实现对应的方法</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>repository</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>model<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span></span><span class="token class-name">Hospital</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>data<span class="token punctuation">.</span>mongodb<span class="token punctuation">.</span>repository<span class="token punctuation">.</span></span><span class="token class-name">MongoRepository</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>stereotype<span class="token punctuation">.</span></span><span class="token class-name">Repository</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Repository</span>
<span class="token keyword">public</span> <span class="token keyword">interface</span> <span class="token class-name">HospitalRepository</span> <span class="token keyword">extends</span> <span class="token class-name">MongoRepository</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">Hospital</span><span class="token punctuation">,</span> <span class="token class-name">String</span><span class="token punctuation">&gt;</span></span> <span class="token punctuation">{</span>
    <span class="token class-name">Hospital</span> <span class="token function">getHospitalByHoscode</span><span class="token punctuation">(</span><span class="token class-name">String</span> hoscode<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><h3 id="service-增加实现方法"><a href="#service-增加实现方法" class="header-anchor">#</a> service 增加实现方法</h3> <p>接口添加相应的方法</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>service</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">Map</span><span class="token punctuation">;</span>

<span class="token keyword">public</span> <span class="token keyword">interface</span> <span class="token class-name">HospitalService</span> <span class="token punctuation">{</span>
    <span class="token comment">/**
     * 上传医院信息
     * @param paramMap
     */</span>
    <span class="token keyword">void</span> <span class="token function">save</span><span class="token punctuation">(</span><span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> paramMap<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><p>实现类</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>service<span class="token punctuation">.</span>impl</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>alibaba<span class="token punctuation">.</span>fastjson<span class="token punctuation">.</span></span><span class="token class-name">JSONObject</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>repository<span class="token punctuation">.</span></span><span class="token class-name">HospitalRepository</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>service<span class="token punctuation">.</span></span><span class="token class-name">HospitalService</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>model<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span></span><span class="token class-name">Hospital</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">lombok<span class="token punctuation">.</span>extern<span class="token punctuation">.</span>slf4j<span class="token punctuation">.</span></span><span class="token class-name">Slf4j</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>beans<span class="token punctuation">.</span>factory<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">Autowired</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>stereotype<span class="token punctuation">.</span></span><span class="token class-name">Service</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">ObjectUtils</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">Date</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">Map</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Slf4j</span>
<span class="token annotation punctuation">@Service</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">HospitalServiceImpl</span> <span class="token keyword">implements</span> <span class="token class-name">HospitalService</span> <span class="token punctuation">{</span>

    <span class="token annotation punctuation">@Autowired</span>
    <span class="token keyword">private</span> <span class="token class-name">HospitalRepository</span> repository<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@Override</span>
    <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">save</span><span class="token punctuation">(</span><span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> paramMap<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        log<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token class-name">JSONObject</span><span class="token punctuation">.</span><span class="token function">toJSONString</span><span class="token punctuation">(</span>paramMap<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token class-name">Hospital</span> hospital <span class="token operator">=</span> <span class="token class-name">JSONObject</span><span class="token punctuation">.</span><span class="token function">parseObject</span><span class="token punctuation">(</span><span class="token class-name">JSONObject</span><span class="token punctuation">.</span><span class="token function">toJSONString</span><span class="token punctuation">(</span>paramMap<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token class-name">Hospital</span><span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token comment">//判断是否存在</span>
        <span class="token class-name">Hospital</span> targetHospital <span class="token operator">=</span> repository<span class="token punctuation">.</span><span class="token function">getHospitalByHoscode</span><span class="token punctuation">(</span>hospital<span class="token punctuation">.</span><span class="token function">getHoscode</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token class-name">ObjectUtils</span><span class="token punctuation">.</span><span class="token function">isEmpty</span><span class="token punctuation">(</span>targetHospital<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token comment">//0：未上线 1：已上线</span>
            hospital<span class="token punctuation">.</span><span class="token function">setStatus</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            hospital<span class="token punctuation">.</span><span class="token function">setCreateTime</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Date</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
            hospital<span class="token punctuation">.</span><span class="token function">setStatus</span><span class="token punctuation">(</span>targetHospital<span class="token punctuation">.</span><span class="token function">getStatus</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            hospital<span class="token punctuation">.</span><span class="token function">setCreateTime</span><span class="token punctuation">(</span>targetHospital<span class="token punctuation">.</span><span class="token function">getCreateTime</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        hospital<span class="token punctuation">.</span><span class="token function">setUpdateTime</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Date</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        hospital<span class="token punctuation">.</span><span class="token function">setIsDeleted</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        repository<span class="token punctuation">.</span><span class="token function">save</span><span class="token punctuation">(</span>hospital<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br></div></div><p>注意，在<code>Hospital</code>类中，需要添加<code>setBookingRule</code>方法，用于json的转换</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>model<span class="token punctuation">.</span>hosp</span><span class="token punctuation">;</span>

<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>

<span class="token annotation punctuation">@Data</span>
<span class="token annotation punctuation">@ApiModel</span><span class="token punctuation">(</span>description <span class="token operator">=</span> <span class="token string">&quot;Hospital&quot;</span><span class="token punctuation">)</span>
<span class="token annotation punctuation">@Document</span><span class="token punctuation">(</span><span class="token string">&quot;Hospital&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Hospital</span> <span class="token keyword">extends</span> <span class="token class-name">BaseMongoEntity</span> <span class="token punctuation">{</span>
	<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
	<span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;预约规则&quot;</span><span class="token punctuation">)</span>
	<span class="token keyword">private</span> <span class="token class-name">BookingRule</span> bookingRule<span class="token punctuation">;</span>

	<span class="token comment">// 重点，重写set方法，通过string传递，需要进行json反序列化操作</span>
	<span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">setBookingRule</span><span class="token punctuation">(</span><span class="token class-name">String</span> bookingRule<span class="token punctuation">)</span> <span class="token punctuation">{</span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>bookingRule <span class="token operator">=</span> <span class="token class-name">JSONObject</span><span class="token punctuation">.</span><span class="token function">parseObject</span><span class="token punctuation">(</span>bookingRule<span class="token punctuation">,</span> <span class="token class-name">BookingRule</span><span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br></div></div><p>同理，在<code>BookingRule</code>也需要重写<code>setRule</code>方法，将json string转换为 <code>List&lt;String&gt;</code>对象</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>model<span class="token punctuation">.</span>hosp</span><span class="token punctuation">;</span>
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>

<span class="token annotation punctuation">@Data</span>
<span class="token annotation punctuation">@ApiModel</span><span class="token punctuation">(</span>description <span class="token operator">=</span> <span class="token string">&quot;预约规则&quot;</span><span class="token punctuation">)</span>
<span class="token annotation punctuation">@Document</span><span class="token punctuation">(</span><span class="token string">&quot;BookingRule&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">BookingRule</span> <span class="token punctuation">{</span>
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
    <span class="token annotation punctuation">@ApiModelProperty</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;预约规则&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">private</span> <span class="token class-name">List</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">&gt;</span></span> rule<span class="token punctuation">;</span>

    <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">setRule</span><span class="token punctuation">(</span><span class="token class-name">String</span> rule<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span><span class="token class-name">StringUtils</span><span class="token punctuation">.</span><span class="token function">isEmpty</span><span class="token punctuation">(</span>rule<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">this</span><span class="token punctuation">.</span>rule <span class="token operator">=</span> <span class="token class-name">JSONArray</span><span class="token punctuation">.</span><span class="token function">parseArray</span><span class="token punctuation">(</span>rule<span class="token punctuation">,</span> <span class="token class-name">String</span><span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br></div></div><h3 id="controller-增加实现方法"><a href="#controller-增加实现方法" class="header-anchor">#</a> controller 增加实现方法</h3> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>controller</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>common<span class="token punctuation">.</span>helper<span class="token punctuation">.</span></span><span class="token class-name">HttpRequestHelper</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>common<span class="token punctuation">.</span>result<span class="token punctuation">.</span></span><span class="token class-name">Result</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>service<span class="token punctuation">.</span></span><span class="token class-name">HospitalService</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">io<span class="token punctuation">.</span>swagger<span class="token punctuation">.</span>annotations<span class="token punctuation">.</span></span><span class="token class-name">Api</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">io<span class="token punctuation">.</span>swagger<span class="token punctuation">.</span>annotations<span class="token punctuation">.</span></span><span class="token class-name">ApiOperation</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>beans<span class="token punctuation">.</span>factory<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">Autowired</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>web<span class="token punctuation">.</span>bind<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">PostMapping</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>web<span class="token punctuation">.</span>bind<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">RequestMapping</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>web<span class="token punctuation">.</span>bind<span class="token punctuation">.</span>annotation<span class="token punctuation">.</span></span><span class="token class-name">RestController</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">javax<span class="token punctuation">.</span>servlet<span class="token punctuation">.</span>http<span class="token punctuation">.</span></span><span class="token class-name">HttpServletRequest</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">Map</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Api</span><span class="token punctuation">(</span>tags <span class="token operator">=</span> <span class="token string">&quot;医院管理API接口&quot;</span><span class="token punctuation">)</span>
<span class="token annotation punctuation">@RestController</span>
<span class="token annotation punctuation">@RequestMapping</span><span class="token punctuation">(</span><span class="token string">&quot;/api/hosp&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">ApiController</span> <span class="token punctuation">{</span>

    <span class="token annotation punctuation">@Autowired</span>
    <span class="token keyword">private</span> <span class="token class-name">HospitalService</span> hospitalService<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiOperation</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;上传医院&quot;</span><span class="token punctuation">)</span>
    <span class="token annotation punctuation">@PostMapping</span><span class="token punctuation">(</span><span class="token string">&quot;saveHospital&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">public</span> <span class="token class-name">Result</span> <span class="token function">saveHospital</span><span class="token punctuation">(</span><span class="token class-name">HttpServletRequest</span> request<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> paramMap <span class="token operator">=</span> <span class="token class-name">HttpRequestHelper</span><span class="token punctuation">.</span><span class="token function">switchMap</span><span class="token punctuation">(</span>request<span class="token punctuation">.</span><span class="token function">getParameterMap</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        hospitalService<span class="token punctuation">.</span><span class="token function">save</span><span class="token punctuation">(</span>paramMap<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">return</span> <span class="token class-name">Result</span><span class="token punctuation">.</span><span class="token function">ok</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br></div></div><ul><li>其中 <code>HttpRequestHelper.switchMap</code> 方法的逻辑是获取请求中每个参数key对应的value数组的第一个值进行返回，对获取的参数进行过滤</li></ul> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> <span class="token function">switchMap</span><span class="token punctuation">(</span><span class="token class-name">Map</span><span class="token operator">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token operator">&gt;</span> paramMap<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> resultMap <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">HashMap</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token punctuation">&gt;</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token class-name">Map<span class="token punctuation">.</span>Entry</span><span class="token operator">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token operator">&gt;</span> param <span class="token operator">:</span> paramMap<span class="token punctuation">.</span><span class="token function">entrySet</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        resultMap<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span>param<span class="token punctuation">.</span><span class="token function">getKey</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> param<span class="token punctuation">.</span><span class="token function">getValue</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">return</span> resultMap<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><h3 id="测试上传数据"><a href="#测试上传数据" class="header-anchor">#</a> 测试上传数据</h3> <p>启动<code>hospital-manager</code>服务，用于模拟发送上传请求</p> <div class="custom-block warning"><p class="custom-block-title">注意</p> <p>由于表 yygh_manage 中没有记录，<code>hospital-manager</code> 启动后，页面会有错误，需要添加一条记录
hoscode 需要与 yygh_hosp.hospital_set 中对应的记录保持一致 ，由于示例数据的hashcode的值是 <code>1000_0</code> 这里也是一样，保持一致</p> <p><code>yygh_manage.hospital_set</code> 表中插入数据</p> <div class="language-sql line-numbers-mode"><pre class="language-sql"><code><span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> yygh_manage<span class="token punctuation">.</span>hospital_set <span class="token punctuation">(</span>id<span class="token punctuation">,</span> hoscode<span class="token punctuation">,</span> sign_key<span class="token punctuation">,</span> api_url<span class="token punctuation">,</span> create_time<span class="token punctuation">,</span> update_time<span class="token punctuation">,</span> is_deleted<span class="token punctuation">)</span>
<span class="token keyword">VALUES</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token string">'1000_0'</span><span class="token punctuation">,</span> <span class="token string">'14721d366cbfee908138c5e599ef17a8'</span><span class="token punctuation">,</span> <span class="token string">'http://localhost:8201'</span><span class="token punctuation">,</span> <span class="token string">'2021-12-06 19:31:55'</span><span class="token punctuation">,</span>
        <span class="token string">'2021-12-06 11:33:41'</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><p><code>yygh_hosp.hospital_set</code> 表中插入数据</p> <div class="language-sql line-numbers-mode"><pre class="language-sql"><code><span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> yygh_hosp<span class="token punctuation">.</span>hospital_set <span class="token punctuation">(</span>id<span class="token punctuation">,</span> hosname<span class="token punctuation">,</span> hoscode<span class="token punctuation">,</span> api_url<span class="token punctuation">,</span> sign_key<span class="token punctuation">,</span> contacts_name<span class="token punctuation">,</span> contacts_phone<span class="token punctuation">,</span> <span class="token keyword">status</span><span class="token punctuation">,</span>
                                    create_time<span class="token punctuation">,</span> update_time<span class="token punctuation">,</span> is_deleted<span class="token punctuation">)</span>
<span class="token keyword">VALUES</span> <span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">,</span> <span class="token string">'北京协和医院'</span><span class="token punctuation">,</span> <span class="token string">'10003'</span><span class="token punctuation">,</span> <span class="token string">'http://localhost:9998'</span><span class="token punctuation">,</span> <span class="token string">'14721d366cbfee908138c5e599ef17a8'</span><span class="token punctuation">,</span> <span class="token string">'stt'</span><span class="token punctuation">,</span> <span class="token string">'13866666666'</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token string">'2021-11-27 12:31:53'</span><span class="token punctuation">,</span> <span class="token string">'2021-12-02 05:32:56'</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div></div> <p><img src="/assets/img/hospManagerUploadPage1.fb020dac.png" alt=""></p> <ul><li>点击医院管理，点击添加，在JSON中输入示例数据<code>hospital.json</code></li></ul> <p><img src="/assets/img/hospManagerUploadPage2.ff5c8154.png" alt=""></p> <details class="custom-block details"><summary>hospital.json</summary> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  <span class="token property">&quot;hoscode&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1000_0&quot;</span><span class="token punctuation">,</span>
  <span class="token property">&quot;hosname&quot;</span><span class="token operator">:</span> <span class="token string">&quot;北京协和医院&quot;</span><span class="token punctuation">,</span>
  <span class="token property">&quot;hostype&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1&quot;</span><span class="token punctuation">,</span>
  <span class="token property">&quot;provinceCode&quot;</span><span class="token operator">:</span> <span class="token string">&quot;110000&quot;</span><span class="token punctuation">,</span>
  <span class="token property">&quot;cityCode&quot;</span><span class="token operator">:</span> <span class="token string">&quot;110100&quot;</span><span class="token punctuation">,</span>
  <span class="token property">&quot;districtCode&quot;</span><span class="token operator">:</span> <span class="token string">&quot;110102&quot;</span><span class="token punctuation">,</span>
  <span class="token property">&quot;address&quot;</span><span class="token operator">:</span> <span class="token string">&quot;大望路&quot;</span><span class="token punctuation">,</span>
  <span class="token property">&quot;intro&quot;</span><span class="token operator">:</span> <span class="token string">&quot;北京协和医院是集医疗、教学、科研于一体的大型三级甲等综合医院，是国家卫生计生委指定的全国疑难重症诊治指导中心，也是最早承担高干保健和外宾医疗任务的医院之一，以学科齐全、技术力量雄厚、特色专科突出、多学科综合优势强大享誉海内外。在2010、2011、2012、2013、2014年复旦大学医院管理研究所公布的“中国最佳医院排行榜”中连续五年名列榜首。\n\n医院建成于1921年，由洛克菲勒基金会创办。建院之初，就志在“建成亚洲最好的医学中心”。90余年来，医院形成了“严谨、求精、勤奋、奉献”的协和精神和兼容并蓄的特色文化风格，创立了“三基”、“三严”的现代医学教育理念，形成了以“教授、病案、图书馆”著称的协和“三宝”，培养造就了张孝骞、林巧稚等一代医学大师和多位中国现代医学的领军人物，并向全国输送了大批的医学管理人才，创建了当今知名的10余家大型综合及专科医院。2011年在总结90年发展经验的基础上，创新性提出了“待病人如亲人，提高病人满意度；待同事如家人，提高员工幸福感”新办院理念。\n\n目前，医院共有2个院区、总建筑面积53万平方米，在职职工4000余名、两院院士5人、临床和医技科室53个、国家级重点学科20个、国家临床重点专科29个、博士点16个、硕士点29个、国家级继续医学教育基地6个、二级学科住院医师培养基地18个、三级学科专科医师培养基地15个。开放住院床位2000余张，单日最高门诊量约1.5万人次、年出院病人约8万余人次。被评为“全国文明单位”、“全国创先争优先进基层党组织”、“全国卫生系统先进集体”、“首都卫生系统文明单位”、“最受欢迎三甲医院”，荣获全国五一劳动奖章。同时，医院还承担着支援老少边穷地区、国家重要活动和突发事件主力医疗队的重任，在2008年北京奥运工作中荣获“特别贡献奖”。\n\n90多年来，协和人以执着的医志、高尚的医德、精湛的医术和严谨的学风书写了辉煌的历史，今天的协和人正为打造“国际知名、国内一流”医院的目标而继续努力。&quot;</span><span class="token punctuation">,</span>
  <span class="token property">&quot;route&quot;</span><span class="token operator">:</span> <span class="token string">&quot;东院区乘车路线：106、108、110、111、116、684、685路到东单路口北；41、104快、814路到东单路口南；1、52、802路到东单路口西；20、25、37、39路到东单路口东；103、104、420、803路到新东安市场；地铁1、5号线到东单。\n西院区乘车路线：68路到辟才胡同东口；更多乘车路线详见须知。&quot;</span><span class="token punctuation">,</span>
  <span class="token property">&quot;logoData&quot;</span><span class="token operator">:</span> <span class="token string">&quot;iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAMAAABOo35HAAADAFBMVEUAAAD///////////7////9/v3///0BTyP8/f39/v///v/8/Pv6+vv//P8DTyb8/f6orrMFTSYITSWosLX7/v7+/f0ETiQBUCYCTyWmr7WorrEBUSMETiL8+/3m6uuosLQGTSL6/PsGTyTKztIKTCnS19oMSSgGTSQJSyOmsLIBUiX5+vn6/P0HTSkHUCgMTCags7H3+vz++/0HSyb5/v2lrrGqr7K9w8cCUCExY0z2/foPSCcKSiW5vsKct7D19vf7//+yuLwTTi4NSCwISiej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D0JSktGa3cuP7jm3L+9vv2rrDxeu7t119FAlV1p6vXRPGGMQpAYkzGWKaM6fikDmCevhjR2M4TUHC8uKlknPbrI94b68qdmTnHKuqgKCJBGGb3QWp6O6c3tp6b7jnmx3Fjudnq7duNK5ckqVBoIxjRFN75weC0MpY2RduZVnCkZorcHC/R7UIMpEp6sxUTWxI7da9QShg/WCTEHTmk3ZTSZ1KKtrui7rTUXe7nJXdl059FaQBOSPpDx7nWjsH0udSlBKkYbWnGUJ9cMgxnJ+SphXXOwwsHHULxmEskIGXhUWgoShVComQwypiDEWVJmhqiqhVM37o7VIGKpjES9yS1zFl7x70x/XUMJCAWwQnvYbHhQIR8LiqE21/AlOCpSKPctMw2QYY0oQUmUIKdQk5UZiwh9PlW2xfcQI3N1an+dYDfY75NY0LIQ55pRSHG0VwzFgBT8+ErdPbJoanT29L5/m/S2bVLgRhnKHdx650bpZtmBaADuE4WeVj/tZhWGqhqQ1DWsQ0GNJFu5L5UmS3jk6VQ6PeBErcmL3ZqgO20LVC0LVcnXrpS22uBApvLTuAByby3OzeUYIooZBiSolpcDP09DBWkZIye+5m6pB4RxOK25ZwvsfADRwxOMWKA6Zn+eVUy2/hAK/UH8DLOGfCiwXPbV+dG5jrWrbME+Gw3ACN8j6qsXU8XE/mjULzCD/YWFx9oUzLMNy6Wx+R7QOiuazOZMxUV/PYIUYWPvnYYGEB5MRiIjch6AP288weARPYRGlw/Gvw3onBCdE8kgSt492fQypcD+Y8n6x/iJYfUkr6Lew+ttgvWnXTnEABIAgCILh/0+GEDAkiBZcocqua7uzO47Obmn1lVjT5vy+vISu9pVYLyGWWCuxArECsQKxArECsQKxArECsQKxArGCd8Uaf2YAAAAAAAAAAADgATPJQLrcXis54wAAAABJRU5ErkJggg==&quot;</span><span class="token punctuation">,</span>
  <span class="token property">&quot;bookingRule&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
    <span class="token property">&quot;cycle&quot;</span><span class="token operator">:</span> <span class="token string">&quot;10&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;releaseTime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;08:30&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;stopTime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;11:30&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;quitDay&quot;</span><span class="token operator">:</span> <span class="token string">&quot;-1&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;quitTime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;15:30&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;rule&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token string">&quot;西院区预约号取号地点：西院区门诊楼一层大厅挂号窗口取号&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;东院区预约号取号地点：东院区老门诊楼一层大厅挂号窗口或新门诊楼各楼层挂号/收费窗口取号&quot;</span>
    <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br></div></div></details> <ul><li>上传完成后，通过mongodb 桌面客户端工具 https://www.mongobooster.com/downloads 查看数据是否真正插入成功</li></ul> <h3 id="图片base4编码处理"><a href="#图片base4编码处理" class="header-anchor">#</a> 图片base4编码处理</h3> <p>图片的base64编码就是可以将一张图片数据编码成一串字符串，使用该<strong>字符串代替图像地址url</strong>
在前端页面中常见的base64图片的引入方式：</p> <div class="language-html line-numbers-mode"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>..<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>优点</p> <ul><li>base64格式的图片是文本格式，占用内存小，转换后的大小比例大概为1/3，降低了资源服务器的消耗</li> <li>网页中使用base64格式的图片时，不用再请求服务器调用图片资源，减少了服务器访问次数</li></ul> <p>缺点</p> <ul><li>base64格式的文本内容较多，存储在数据库中增大了数据库服务器的压力</li> <li>网页加载图片虽然不用访问服务器了，但因为base64格式的内容太多，所以加载网页的速度会降低，可能会影响用户的体验</li></ul> <p>项目说明</p> <ul><li>医院logo图片小，因此上传医院logo是可以使用base64格式保存</li></ul> <h4 id="在-common-util-中添加-base64util"><a href="#在-common-util-中添加-base64util" class="header-anchor">#</a> 在 <code>common-util</code> 中添加 Base64Util</h4> <p>将图片转换为base64编码，供后续使用</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>common<span class="token punctuation">.</span>util</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>apache<span class="token punctuation">.</span>commons<span class="token punctuation">.</span>codec<span class="token punctuation">.</span>binary<span class="token punctuation">.</span></span><span class="token class-name">Base64</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>io<span class="token punctuation">.</span></span><span class="token class-name">File</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>io<span class="token punctuation">.</span></span><span class="token class-name">FileInputStream</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>io<span class="token punctuation">.</span></span><span class="token class-name">InputStream</span><span class="token punctuation">;</span>

<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">ImageBase64Util</span> <span class="token punctuation">{</span>

    <span class="token comment">// 测试</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token class-name">String</span> imageFile <span class="token operator">=</span> <span class="token string">&quot;D:\\xh.png&quot;</span><span class="token punctuation">;</span> <span class="token comment">// 待处理的图片</span>
        <span class="token class-name">System</span><span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token function">getImageString</span><span class="token punctuation">(</span>imageFile<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token class-name">String</span> <span class="token function">getImageString</span><span class="token punctuation">(</span><span class="token class-name">String</span> imageFile<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token class-name">InputStream</span> is <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">;</span>
        <span class="token keyword">try</span> <span class="token punctuation">{</span>
            <span class="token keyword">byte</span><span class="token punctuation">[</span><span class="token punctuation">]</span> data <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">;</span>
            is <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">FileInputStream</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">File</span><span class="token punctuation">(</span>imageFile<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            data <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token keyword">byte</span><span class="token punctuation">[</span>is<span class="token punctuation">.</span><span class="token function">available</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
            is<span class="token punctuation">.</span><span class="token function">read</span><span class="token punctuation">(</span>data<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">return</span> <span class="token keyword">new</span> <span class="token class-name">String</span><span class="token punctuation">(</span><span class="token class-name">Base64</span><span class="token punctuation">.</span><span class="token function">encodeBase64</span><span class="token punctuation">(</span>data<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span><span class="token class-name">Exception</span> e<span class="token punctuation">)</span> <span class="token punctuation">{</span>
            e<span class="token punctuation">.</span><span class="token function">printStackTrace</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span> <span class="token keyword">finally</span> <span class="token punctuation">{</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token keyword">null</span> <span class="token operator">!=</span> is<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token keyword">try</span> <span class="token punctuation">{</span>
                    is<span class="token punctuation">.</span><span class="token function">close</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    is <span class="token operator">=</span> <span class="token keyword">null</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span><span class="token class-name">Exception</span> e<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                    e<span class="token punctuation">.</span><span class="token function">printStackTrace</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
        <span class="token keyword">return</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br></div></div><h4 id="上传医院接口修正"><a href="#上传医院接口修正" class="header-anchor">#</a> 上传医院接口修正</h4> <p>图片转换为base64字符串时，该字符串中包含大量的加号“+”，服务器在解析数据时会把加号当成连接符，<strong>转换为空格</strong>，因此要做一下特殊处理</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>controller</span><span class="token punctuation">;</span>
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token annotation punctuation">@Api</span><span class="token punctuation">(</span>tags <span class="token operator">=</span> <span class="token string">&quot;医院管理API接口&quot;</span><span class="token punctuation">)</span>
<span class="token annotation punctuation">@RestController</span>
<span class="token annotation punctuation">@RequestMapping</span><span class="token punctuation">(</span><span class="token string">&quot;/api/hosp&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">ApiController</span> <span class="token punctuation">{</span>

    <span class="token annotation punctuation">@Autowired</span>
    <span class="token keyword">private</span> <span class="token class-name">HospitalService</span> hospitalService<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@Autowired</span>
    <span class="token keyword">private</span> <span class="token class-name">HospitalSetService</span> hospitalSetService<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiOperation</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;上传医院&quot;</span><span class="token punctuation">)</span>
    <span class="token annotation punctuation">@PostMapping</span><span class="token punctuation">(</span><span class="token string">&quot;saveHospital&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">public</span> <span class="token class-name">Result</span> <span class="token function">saveHospital</span><span class="token punctuation">(</span><span class="token class-name">HttpServletRequest</span> request<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token comment">// 获取从医院获取的信息</span>
        <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> paramMap <span class="token operator">=</span> <span class="token class-name">HttpRequestHelper</span><span class="token punctuation">.</span><span class="token function">switchMap</span><span class="token punctuation">(</span>request<span class="token punctuation">.</span><span class="token function">getParameterMap</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">//传输过程中“+”转换为了“ ”，因此要转换回来</span>
        <span class="token class-name">String</span> logoDataString <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">)</span>paramMap<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">&quot;logoData&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token class-name">StringUtils</span><span class="token punctuation">.</span><span class="token function">isEmpty</span><span class="token punctuation">(</span>logoDataString<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token class-name">String</span> logoData <span class="token operator">=</span> logoDataString<span class="token punctuation">.</span><span class="token function">replaceAll</span><span class="token punctuation">(</span><span class="token string">&quot; &quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;+&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            paramMap<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span><span class="token string">&quot;logoData&quot;</span><span class="token punctuation">,</span> logoData<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

        hospitalService<span class="token punctuation">.</span><span class="token function">save</span><span class="token punctuation">(</span>paramMap<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">return</span> <span class="token class-name">Result</span><span class="token punctuation">.</span><span class="token function">ok</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br></div></div><h3 id="添加签名校验"><a href="#添加签名校验" class="header-anchor">#</a> 添加签名校验</h3> <p>在上传过程中，需要对上传的数据做签名校验，下面补充签名校验的逻辑
在医院设置的时候，为每个医院生成了医院编码与签名key，在验证签名时要根据医院编码去动态获取签名key，然后再做签名校验</p> <ul><li>上传时，将传输的参数与signKey做md5加密得到数字签名作为参数的一部分，在线预约系统收到请求时，对上传的参数和本地查询的signKey做md5加密得到数字签名，2个签名相同，表示请求正确</li> <li>注意：在添加签名时，需要对请求的参数中关于Base64的图片部分做处理，传输过程中会把 + 改为 空格，需要反向处理，得到真实的参数，然后再做数字签名校验，否则会报错</li></ul> <div class="language-java line-numbers-mode"><div class="highlight-lines"><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><div class="highlighted"> </div><div class="highlighted"> </div><br><br><div class="highlighted"> </div><div class="highlighted"> </div><br><br><br><br><br><br><br></div><pre class="language-java"><code><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token annotation punctuation">@Api</span><span class="token punctuation">(</span>tags <span class="token operator">=</span> <span class="token string">&quot;医院管理API接口&quot;</span><span class="token punctuation">)</span>
<span class="token annotation punctuation">@RestController</span>
<span class="token annotation punctuation">@RequestMapping</span><span class="token punctuation">(</span><span class="token string">&quot;/api/hosp&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">ApiController</span> <span class="token punctuation">{</span>

    <span class="token annotation punctuation">@Autowired</span>
    <span class="token keyword">private</span> <span class="token class-name">HospitalService</span> hospitalService<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@Autowired</span>
    <span class="token keyword">private</span> <span class="token class-name">HospitalSetService</span> hospitalSetService<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@ApiOperation</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;上传医院&quot;</span><span class="token punctuation">)</span>
    <span class="token annotation punctuation">@PostMapping</span><span class="token punctuation">(</span><span class="token string">&quot;saveHospital&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">public</span> <span class="token class-name">Result</span> <span class="token function">saveHospital</span><span class="token punctuation">(</span><span class="token class-name">HttpServletRequest</span> request<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token comment">// 获取从医院获取的信息</span>
        <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> paramMap <span class="token operator">=</span> <span class="token class-name">HttpRequestHelper</span><span class="token punctuation">.</span><span class="token function">switchMap</span><span class="token punctuation">(</span>request<span class="token punctuation">.</span><span class="token function">getParameterMap</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

      <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
          
        <span class="token comment">// 依据传递的医院编码，查询数据库，查询签名</span>
        <span class="token class-name">String</span> hoscode <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">)</span> paramMap<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">&quot;hoscode&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token class-name">String</span> signKey <span class="token operator">=</span> hospitalSetService<span class="token punctuation">.</span><span class="token function">getSignKey</span><span class="token punctuation">(</span>hoscode<span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">// 判断签名是否一致</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span><span class="token class-name">HttpRequestHelper</span><span class="token punctuation">.</span><span class="token function">isSignEquals</span><span class="token punctuation">(</span>paramMap<span class="token punctuation">,</span> signKey<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">throw</span> <span class="token keyword">new</span> <span class="token class-name">YyghException</span><span class="token punctuation">(</span><span class="token class-name">ResultCodeEnum</span><span class="token punctuation">.</span>SIGN_ERROR<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

        hospitalService<span class="token punctuation">.</span><span class="token function">save</span><span class="token punctuation">(</span>paramMap<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">return</span> <span class="token class-name">Result</span><span class="token punctuation">.</span><span class="token function">ok</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br></div></div><h2 id="查询医院信息接口定义"><a href="#查询医院信息接口定义" class="header-anchor">#</a> 查询医院信息接口定义</h2> <p>参考 <a href="/pages/678e2d/#查询医院">附录：在线预约挂号API接口文档</a> 平台接口 -&gt; 查询医院</p> <h3 id="提交地址-2"><a href="#提交地址-2" class="header-anchor">#</a> 提交地址</h3> <p>http://localhost/api/hosp/hospital/show</p> <h3 id="请求参数-2"><a href="#请求参数-2" class="header-anchor">#</a> 请求参数</h3> <p>变量定义</p> <table><thead><tr><th>字段名</th> <th>类型</th> <th>长度</th> <th>必输</th> <th>说明</th></tr></thead> <tbody><tr><td>hoscode</td> <td>string</td> <td>30</td> <td>是</td> <td>给医院分配的唯一标识</td></tr> <tr><td>timestamp</td> <td>long</td> <td></td> <td>是</td> <td>时间戳；从1970-01-01 00:00:00算起的毫秒数</td></tr> <tr><td>sign</td> <td>string</td> <td>32</td> <td>是</td> <td>验签参数</td></tr></tbody></table> <h3 id="同步返回-2"><a href="#同步返回-2" class="header-anchor">#</a> 同步返回</h3> <p>结果参数含义</p> <table><thead><tr><th style="text-align:left;">字段名</th> <th>类型</th> <th>长度</th> <th>必输</th> <th>说明</th></tr></thead> <tbody><tr><td style="text-align:left;">code</td> <td>string</td> <td></td> <td>是</td> <td>结果编码； 200：请求成功  不等于200：请求失败（message：失败原因）</td></tr> <tr><td style="text-align:left;">message</td> <td>string</td> <td>100</td> <td>是</td> <td>结果描述</td></tr> <tr><td style="text-align:left;">data</td> <td>string</td> <td>5000</td> <td>是</td> <td></td></tr></tbody></table> <h2 id="查询医院信息接口实现-service-hosp"><a href="#查询医院信息接口实现-service-hosp" class="header-anchor">#</a> 查询医院信息接口实现 service-hosp</h2> <h3 id="service-增加实现方法-2"><a href="#service-增加实现方法-2" class="header-anchor">#</a> service 增加实现方法</h3> <p>在HospitalService 类添加接口</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>service</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>model<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span></span><span class="token class-name">Hospital</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>util<span class="token punctuation">.</span></span><span class="token class-name">Map</span><span class="token punctuation">;</span>

<span class="token keyword">public</span> <span class="token keyword">interface</span> <span class="token class-name">HospitalService</span> <span class="token punctuation">{</span>
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
    <span class="token comment">/**
     * 查询医院
     * @param hoscode
     * @return
     */</span>
    <span class="token class-name">Hospital</span> <span class="token function">getByHoscode</span><span class="token punctuation">(</span><span class="token class-name">String</span> hoscode<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br></div></div><p>在HospitalServiceImpl类添加实现</p> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>service<span class="token punctuation">.</span>impl</span><span class="token punctuation">;</span>
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token annotation punctuation">@Slf4j</span>
<span class="token annotation punctuation">@Service</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">HospitalServiceImpl</span> <span class="token keyword">implements</span> <span class="token class-name">HospitalService</span> <span class="token punctuation">{</span>

    <span class="token annotation punctuation">@Autowired</span>
    <span class="token keyword">private</span> <span class="token class-name">HospitalRepository</span> repository<span class="token punctuation">;</span>
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
    <span class="token annotation punctuation">@Override</span>
    <span class="token keyword">public</span> <span class="token class-name">Hospital</span> <span class="token function">getByHoscode</span><span class="token punctuation">(</span><span class="token class-name">String</span> hoscode<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">return</span> repository<span class="token punctuation">.</span><span class="token function">getHospitalByHoscode</span><span class="token punctuation">(</span>hoscode<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br></div></div><h3 id="controller-增加实现方法-2"><a href="#controller-增加实现方法-2" class="header-anchor">#</a> controller 增加实现方法</h3> <div class="language-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>stt<span class="token punctuation">.</span>yygh<span class="token punctuation">.</span>hosp<span class="token punctuation">.</span>controller</span><span class="token punctuation">;</span>
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token annotation punctuation">@Api</span><span class="token punctuation">(</span>tags <span class="token operator">=</span> <span class="token string">&quot;医院管理API接口&quot;</span><span class="token punctuation">)</span>
<span class="token annotation punctuation">@RestController</span>
<span class="token annotation punctuation">@RequestMapping</span><span class="token punctuation">(</span><span class="token string">&quot;/api/hosp&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">ApiController</span> <span class="token punctuation">{</span>

<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
    <span class="token annotation punctuation">@ApiOperation</span><span class="token punctuation">(</span>value <span class="token operator">=</span> <span class="token string">&quot;获取医院信息&quot;</span><span class="token punctuation">)</span>
    <span class="token annotation punctuation">@PostMapping</span><span class="token punctuation">(</span><span class="token string">&quot;hospital/show&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">public</span> <span class="token class-name">Result</span> <span class="token function">hospital</span><span class="token punctuation">(</span><span class="token class-name">HttpServletRequest</span> request<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">Object</span><span class="token punctuation">&gt;</span></span> paramMap <span class="token operator">=</span> <span class="token class-name">HttpRequestHelper</span><span class="token punctuation">.</span><span class="token function">switchMap</span><span class="token punctuation">(</span>request<span class="token punctuation">.</span><span class="token function">getParameterMap</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token class-name">String</span> hoscode <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">)</span> paramMap<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string">&quot;hoscode&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token class-name">StringUtils</span><span class="token punctuation">.</span><span class="token function">isEmpty</span><span class="token punctuation">(</span>hoscode<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">throw</span> <span class="token keyword">new</span> <span class="token class-name">YyghException</span><span class="token punctuation">(</span><span class="token class-name">ResultCodeEnum</span><span class="token punctuation">.</span>PARAM_ERROR<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        <span class="token comment">//签名校验</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span><span class="token class-name">HttpRequestHelper</span><span class="token punctuation">.</span><span class="token function">isSignEquals</span><span class="token punctuation">(</span>paramMap<span class="token punctuation">,</span> hospitalSetService<span class="token punctuation">.</span><span class="token function">getSignKey</span><span class="token punctuation">(</span>hoscode<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">throw</span> <span class="token keyword">new</span> <span class="token class-name">YyghException</span><span class="token punctuation">(</span><span class="token class-name">ResultCodeEnum</span><span class="token punctuation">.</span>SIGN_ERROR<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        <span class="token keyword">return</span> <span class="token class-name">Result</span><span class="token punctuation">.</span><span class="token function">ok</span><span class="token punctuation">(</span>hospitalService<span class="token punctuation">.</span><span class="token function">getByHoscode</span><span class="token punctuation">(</span>hoscode<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br></div></div><h3 id="测试列表"><a href="#测试列表" class="header-anchor">#</a> 测试列表</h3> <p>hospital-manager服务从service-hosp服务中获取刚刚添加的医院列表信息，若获取成功，表示之前上传的信息成功了</p> <p><img src="/assets/img/hospManagerUploadPage3.5975c5d4.png" alt=""></p></div></div>  <div class="page-edit"><!----> <!----> <div class="last-updated"><span class="prefix">Last Updated:</span> <span class="time">2022/01/16, 11:29:51</span></div></div> <div class="page-nav-wapper"><div class="page-nav-centre-wrap"><a href="/pages/cfa99b/" class="page-nav-centre page-nav-centre-prev"><div class="tooltip">11.启动医院接口模拟系统</div></a> <a href="/pages/85c8c5/" class="page-nav-centre page-nav-centre-next"><div class="tooltip">13.后台系统-上传科室信息</div></a></div> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/pages/cfa99b/" class="prev">11.启动医院接口模拟系统</a></span> <span class="next"><a href="/pages/85c8c5/">13.后台系统-上传科室信息</a>→
      </span></p></div></div></div> <!----></main></div> <div class="footer"><div class="icons"><a href="mailto:work_stt@163.com" title="email" target="_blank" class="iconfont icon-youjian"></a><a href="https://github.com/shetengteng" title="GitHub" target="_blank" class="iconfont icon-github"></a></div> 
  Theme by
  <a href="https://github.com/xugaoyi/vuepress-theme-vdoing" target="_blank" title="本站主题">Vdoing</a> 
    | Copyright © 2021-2022
    <span>Shetengteng | MIT License</span></div> <div class="buttons"><div title="返回顶部" class="button blur go-to-top iconfont icon-fanhuidingbu" style="display:none;"></div> <div title="去评论" class="button blur go-to-comment iconfont icon-pinglun" style="display:none;"></div> <div title="主题模式" class="button blur theme-mode-but iconfont icon-zhuti"><ul class="select-box" style="display:none;"><li class="iconfont icon-zidong">
          跟随系统
        </li><li class="iconfont icon-rijianmoshi">
          浅色模式
        </li><li class="iconfont icon-yejianmoshi">
          深色模式
        </li><li class="iconfont icon-yuedu">
          阅读模式
        </li></ul></div></div> <!----> <!----> <!----></div><div class="global-ui"><div></div></div></div>
    <script src="/assets/js/app.ab6a7ec7.js" defer></script><script src="/assets/js/2.bc9beebf.js" defer></script><script src="/assets/js/33.4f600444.js" defer></script>
  </body>
</html>
